[R] Don´t know what test i have to use

Joshua Wiley jwiley.psych at gmail.com
Wed Jan 12 19:43:49 CET 2011


Hi,

That is basically correct.  You can specify the link as logit (see my
example), but that is the default so you do not strictly need to in
this case.  II would encourage you to keep your variables
(prevalencia, edad, sexo, mes) stored in a data frame, in which case
you would add the data = argument to glm().

model2 <- glm(prevalencia ~ edad * sexo * mes * zona,
  family = binomial(link = "logit"),
  data = your_dataframe)

Also, you might take a look at ?predict.glm  it has some examples with
binomial data based off the wonderful book by Drs. Venables and
Ripley.  Oh, and finally, if you have 12 levels of months, ? levels of
zones, and 2 levels of sex, you might not want the 4way interactions
that you will get by default from using the '*' operator inside a
formula.  Unless you have a theory that there is an additional effect
of being a middle aged female in the month of July for zone 8, but
not....

Cheers,

Josh

On Wed, Jan 12, 2011 at 9:51 AM, gaiarrido <gaiarrido at usal.es> wrote:
>
> Hello,
> I´m starting with my PhD and I have to stop because i got a little knowledge
> in R and statistics.
> I´ve got a model of this kind:
> binary response variable: prevalence of infection (0/1)
> 3 categorical independent variables: sex, month and name of the area
>
> I was trying with a full model like this, before the simplification
>
> model<-aov(prevalencia~sex*month*area)
>
> but the Fligner test told that i haven´t got homoscedascity, so I suppose I
> should trying with glm, with a model
>
> model2<-glm(prevalencia~edad*sexo*mes*zona,binomial)
>
> is that correct? where I must put the link (logit) ?
>
> Thnks very much
> --
> View this message in context: http://r.789695.n4.nabble.com/Don-t-know-what-test-i-have-to-use-tp3214491p3214491.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>



-- 
Joshua Wiley
Ph.D. Student, Health Psychology
University of California, Los Angeles
http://www.joshuawiley.com/



More information about the R-help mailing list