Skip to content
Prev 248707 / 398506 Next

Problems making subsets with [] or "subset"

Hi,
I'm trying to make a model in order to know wich factors got?s influence in
the intensity of a infection, but just in the individuals who's got this
infection. In my data I've got a variable called "prevalence" with 2 levels:
1.- Infected individual
0.- Non infected

So what i'm trying to do is a subset in a model like this,
model<-aov(intensity~ageandsex*month*zone*year,subset=(prevalence=="1"))
Is a correct way?
I prefer to make the subsets with [], but doesn't work, why
Error: inesperado '[' en
"model<-aov(hemogregarinas~edadysexo*mes*zona*ano,["

And finally, look at this, i don't know why I get different results
Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
   1.00    5.00    9.00   15.94   19.00  173.00
Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
   0.00    4.00    9.00   14.92   18.00  173.00 

Thanks very much

-----
Mario Garrido Escudero
PhD student
Dpto. de Biolog?a Animal, Ecolog?a, Parasitolog?a, Edafolog?a y Qca.
Agr?cola
Universidad de Salamanca