t_contrast_rm.Rd
t-test contrasts for one-way repeated measures
t_contrast_rm(df, subject, dv, condition, A_levels, B_levels, contrast_weights, report = TRUE)
df | A long format dataframe |
---|---|
subject | name of the subject column |
dv | name of the dependent variable column |
condition | name of the condition for the one-way manipulation |
A_levels | character vector, including the names of the levels for the first side of the contrast |
B_levels | character vector, including the names of the levels for the second side of the contrast |
contrast_weights | numeric vector, including the contrast weights for all levels, in the same order as they are listed in A and B levels |
report | logical, TRUE = the t.test summary will print out even if you assign the object to a variable, FALSE = no extra printing |
t.test summary
some_data <- data.frame(s = rep(1:10,3), measure = rnorm(30,0,1), manipulation = as.factor(rep(c("A","B","C"),each=10))) t_contrast_rm(df = some_data, subject = "s", dv = "measure", condition = "manipulation", A_levels = c("A"), B_levels = c("B","C"), contrast_weights = c(-1,.5,.5))#> #> One Sample t-test #> #> data: contrast_vector #> t = 0.68467, df = 9, p-value = 0.5108 #> alternative hypothesis: true mean is not equal to 0 #> 95 percent confidence interval: #> -0.6687136 1.2491879 #> sample estimates: #> mean of x #> 0.2902371 #>#> #> One Sample t-test #> #> data: contrast_vector #> t = 0.68467, df = 9, p-value = 0.5108 #> alternative hypothesis: true mean is not equal to 0 #> 95 percent confidence interval: #> -0.6687136 1.2491879 #> sample estimates: #> mean of x #> 0.2902371 #>