[R] HEEELP!!!!
cls59
chuck at sharpsteen.net
Tue Nov 10 21:01:36 CET 2009
Ana María Prieto wrote:
>
> Hello.
> My name is Ana. I´m doing an eology master, and I´m just learning how R
> works.
> I have a Mac OS X 10.5.6, and I´m tryng to run just a simple ANOVA
> nanalyses.
> I dowloaded R version 2.10.0, and it seems I have problems with the
> script.
> I don´t know what to do, I´ve already change the languages, be sure of
> being
> working in the correct directory and doesn´t work
>
> the script is:
>
> #1. example
>
> data01<-read.table("ch01.txt",header=T)
>
> names(data01)
>
> attach(data01)
>
> FERTIL<-factor(FERTIL)
>
> model01<-(YIELD~FERTIL)
>
> summary(model01)
>
> anova(model01)
>
>
> all my classmates, even those with a mac operator, wrote the same, and it
> worked.
>
>
Well, the line:
model01 <- (YIELD~FERTIL)
Creates an object of class "formula", which is not a model. A formula only
expresses a relationship between variables, a model consists of a formula
that has been fit to a data set. The anova() function has no meaning for
formula objects since no data has been fit. If you wanted a linear model,
use the lm() function to create it:
model01 <- lm( YIELD ~ FERTIL )
Non-linear functions may be fit using nls() and R has plenty of other
fitting schemes if you should require them.
Ana María Prieto wrote:
>
>
> When copying the script in the R console, it seems that there is a problem
> with the
>
> ~ symbol. this symbol is not in the keyboard, so I select it from spetial
> characters,
>
> and then i selected with shift an <>key, and still, it doesn´t works
>
>
On my keyboard the '~' character is accessed by pressing SHIFT-backtick,
where backtick is the key above the "Tab" key and to the left of the "1"
key. You may have a different keyboard.
Ana María Prieto wrote:
>
>
> I attached th file with the data. i hope you can help me!!!!!
>
> Ana.
>
>
-----
Charlie Sharpsteen
Undergraduate
Environmental Resources Engineering
Humboldt State University
--
View this message in context: http://old.nabble.com/HEEELP%21%21%21%21-tp26288374p26289075.html
Sent from the R help mailing list archive at Nabble.com.
More information about the R-help
mailing list