[R] Learning ANOVA
satimis at yahoo.com
Sat Aug 14 06:03:00 CEST 2010
Thanks for your advice which works for me here.
An Introduction to R
NOT finish yet. Also I found many tutorials on Internet. I'll take me time
going through all of them.
I'm interesting reading tutorial with demo. Otherwise it won't be easy for a
beginning remembering all commands and steps on manual.
----- Original Message ----
From: Christopher W Ryan <cryan at binghamton.edu>
To: R-help at r-project.org
Sent: Sat, August 14, 2010 1:51:34 AM
Subject: Re: [R] Learning ANOVA
Read documentation for TukeyHSD by typing the command:
The input to that function should usually be, "a fitted model object,
usually an aov fit."
You have not created a "fitted model object."
This seems to work:
model <- aov(InsectSprays$count ~ InsectSprays$spray)
The aov() makes the aov model object. Tacking .aov onto an object name
doesn't do that.
Which introductory R book(s) have you read? That would be a worthwhile
investment of your time.
On Fri, Aug 13, 2010 at 12:43 PM, Stephen Liu <satimis at yahoo.com> wrote:
> Hi Erik,
> I followed following video as example;
> ANOVA in R
> Now I got it done;
> > boxplot(test01$count ~ test01$spray)
> > InsectSprays.aov <-(test01$count ~ test01$spray)
> > summary(InsectSprays.aov)
> Length Class Mode
> 3 formula call
> Seems having problem here.
> > TukeyHSD(InsectSprays.aov)
> Error in UseMethod("TukeyHSD") :
> no applicable method for 'TukeyHSD' applied to an object of class
> I'm still stuck here.
> Stephen L
> ----- Original Message ----
> From: Erik Iverson <eriki at ccbr.umn.edu>
> To: Stephen Liu <satimis at yahoo.com>
> Cc: r-help at r-project.org
> Sent: Sat, August 14, 2010 12:15:31 AM
> Subject: Re: [R] Learning ANOVA
> > Performed following steps on R:-
> > ### to access to the object
> >> data(InsectSprays)
> > ### create a .csv file
> >> write.csv(InsectSprays, "InsectSpraysCopy.csv")
> > On another terminal
> > $ sudo updatedb
> > $ locate InsectSpraysCopy.csv
> > /home/userA/InsectSpraysCopy.csv
> > ### Read in some data
> >> test01 <- read.csv(file.choose(), header=TRUE)
> > Enter file name: /home/userA/InsectSpraysCopy.csv
> I either don't understand what you're doing, or you seem
> very confused.
> R comes with many sample data sets for you to use.
> You can see a list of them using the ?data function.
> Calling data with an argument loads that dataset.
> So, when you type:
> > data(InsectSprays)
> that data object is now available in R, see
> > objects()
> You can look at it simply by printing it:
> > InsectSprays
> If for some reason it makes sense to do it this way for your
> use case, then that's fine, I just want to make sure you understand
> that you don't have to if accessing built-in datasets is all you want.
> > ### Look at the data
> >> test01
> > X count spray
> > 1 1 10 A
> > 2 2 7 A
> > 3 3 20 A
> > ### Create a side-by-side boxplot of the data
> > boxplot(test01$DO ~ test01$Stream)
> > Error in model.frame.default(formula = test01$DO ~ test01$Stream) :
> >type (NULL) for variable 'test01$DO'
> Why do you think test01 has an element called "D0" or "Stream"?? The
> column names when you print the data tell you otherwise!
> R-help at r-project.org mailing list
> PLEASE do read the posting guide
> and provide commented, minimal, self-contained, reproducible code.
[[alternative HTML version deleted]]
R-help at r-project.org mailing list
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
More information about the R-help