![]() It would also be fine to do it the other way around. ![]() ![]() # I'm choosing to plot with instruction type across the x-axis and grouped by age. # Fit: aov(formula = score ~ dose, data = data) TukeyTest # Tukey multiple comparisons of means # we tell R to get a polynomial contrast matrix for 3 conditions These are the orthogonal polynomial contrasts. # Here's one way - tell R which groups to compare. Geom_errorbar(aes(ymin=mean-ci, ymax=mean+ci), width=.1) +įor additional info on setting up contrasts (beyond the scope of this lab), check out the ever useful UCLA stats walkthrough # run an ANOVA # %+% ggplot(plot.data, aes(x=dose, y=mean, group = factor(1))) + # The following object is masked from 'package:psych': Plot.data # take a peek # Source: local data frame # intersect, setdiff, setequal, union groups <- group_by(data, dose) # this just prepares it for us to calculate eveyrthing within each condition # The following objects are masked from 'package:base': # The following objects are masked from 'package:stats': Library(dplyr) # Warning: package 'dplyr' was built under R version 3.2.2 # # To do that, we'll use a few functions from the dplyr package. # Since we're not plotting the data themselves but rather means, first we need to calculate that, so we can feed it into the plot. # Lets take a look at the data - do we see a linear trend? codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1īefore we run an ANOVA, let’s obtain a plot to get an idea of how the sample means differ.Ĭheck out this useful tutorial: (ggplot2)/ # clear the environmentĭata <- read.csv("RClub_DataSet2_11.3.15.csv", header = TRUE) Planned Contrasts in R # read in Data Set #1
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |