... But I would think that month should be treated as a cyclical
quantity, not as a factor with 12 independent levels, e.g. by
transforming month to  sin( 2*pi*monthNumber/12) .  This assumes 1
year periodicity, which might not be right, of course. Time series
methods could obviously be relevant here. Given the possible
importance of such periodicity and the relative complexity of the
methodology necessary to deal with it properly, you might benefit by
consulting your local statistician for help.

-- Bert

On Wed, Jan 12, 2011 at 10:43 AM, Joshua Wiley <jwiley.ps...@gmail.com> wrote:
> 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 <gaiarr...@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@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/
>
> ______________________________________________
> R-help@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.
>



-- 
Bert Gunter
Genentech Nonclinical Biostatistics

______________________________________________
R-help@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.

Reply via email to