[R] multivariate analysis

Rosario Garcia Gil M.Rosario.Garcia at genfys.slu.se
Fri Nov 26 12:55:31 CET 2010


Hi

I have 1800 response variables to regress on two factors (latitude and age), what is the script to run all response variables at once instead of writing 1800 models?

Thanks
R.

________________________________________
Lähettäjä: r-help-bounces at r-project.org [r-help-bounces at r-project.org] käyttäjän Dennis Murphy [djmuser at gmail.com] puolesta
Lähetetty: 25. marraskuuta 2010 16:57
Vastaanottaja: Diogo B. Provete
Kopio: r-help at r-project.org
Aihe: Re: [R] Generalized linear models with categorical data

Hi:

On Thu, Nov 25, 2010 at 3:53 AM, Diogo B. Provete <dbprovete at gmail.com>wrote:

> I got a question about using a GLZ with categorical x categorical data.
> Below there is a data set I want to know the influence of treatments (CONT,
> and LPS2H LPS24H) on the categories of pigmentation of the right testis of
> an amphibian. From these data, I used the function glm with binomial family
> (logit). But in the result (see below) is not possible to know the
> influence
> of the three treatments on the categories, only the treatments as a whole.
> Could someone help me?
>

You have three response categories, which makes the response multinomial,
not binomial.

with(td, table(Tratamento, Categoria))
          Categoria
Tratamento Cat.1 Cat.2 Cat.3
    CONT       0     4     6
    LPS24h     5     5     0
    LPS2h      0     3     7

Why is it that for each treatment, the responses only fall into two of the
three categories? Is this by happenstance or by design? Methinks some
information is lacking at the moment...but I'm pretty sure the binomial
model is not correct in its current manifestation.

Dennis

Thanks in advance
>
>
> > td=read.table(file.choose(), h=T)
> > td
>   Tratamento Categoria
> 1        CONT     Cat.2
> 2        CONT     Cat.2
> 3        CONT     Cat.2
> 4        CONT     Cat.2
> 5        CONT     Cat.3
> 6        CONT     Cat.3
> 7        CONT     Cat.3
> 8        CONT     Cat.3
> 9        CONT     Cat.3
> 10       CONT     Cat.3
> 11      LPS2h     Cat.2
> 12      LPS2h     Cat.2
> 13      LPS2h     Cat.2
> 14      LPS2h     Cat.3
> 15      LPS2h     Cat.3
> 16      LPS2h     Cat.3
> 17      LPS2h     Cat.3
> 18      LPS2h     Cat.3
> 19      LPS2h     Cat.3
> 20      LPS2h     Cat.3
> 21     LPS24h     Cat.1
> 22     LPS24h     Cat.1
> 23     LPS24h     Cat.1
> 24     LPS24h     Cat.1
> 25     LPS24h     Cat.1
> 26     LPS24h     Cat.2
> 27     LPS24h     Cat.2
> 28     LPS24h     Cat.2
> 29     LPS24h     Cat.2
> 30     LPS24h     Cat.2
>
> > mod.test=glm(Categoria~Tratamento, family=binomial(logit), data=td)
>
> > mod.test
>
> Call:  glm(formula = Categoria ~ Tratamento, family = binomial(logit),
>    data = td)
>
> Coefficients:
>     (Intercept)  TratamentoLPS24h   TratamentoLPS2h
>       2.057e+01        -2.057e+01         1.558e-08
>
> Degrees of Freedom: 29 Total (i.e. Null);  27 Residual
> Null Deviance:    27.03
> Residual Deviance: 13.86 AIC: 19.86
>
> > anova(mod.test, test="Chisq")
> Analysis of Deviance Table
>
> Model: binomial, link: logit
>
> Response: Categoria
>
> Terms added sequentially (first to last)
>
>
>           Df Deviance Resid. Df Resid. Dev P(>|Chi|)
> NULL                          29     27.034
> Tratamento  2   13.171        27     13.863  0.001380 **
> ---
> Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
> >
>
> --
> Atenciosamente,
> *Diogo Borges Provete*
>
> ==============================
> Biólogo
> Mestre em Biologia Animal (UNESP)
> Laboratório de Ecologia Animal
> Departamento de Zoologia e Botânica
> Instituto de Biociências, Letras e Ciências Exatas
> Universidade Estadual Paulista - UNESP
> São José do Rio Preto-SP
> Brazil
>
> Rua Cristóvão Colombo, 2265
> Jardim Nazareth -  15054-000
>
> *Skype*: diogoprovete
> *MSN*: diogoprov at yahoo.com.br
>
> *Personal web page <https://sites.google.com/site/diogoprovetepage/>*
>
> Traduza conosco:
> <<<American Journal Experts>>> <http://www.journalexperts.com/br/>
> <<<D-Lang  Soluções linguisticas<
> http://www.d-lang.com.br/site/sitept/index.htm>
> >>>
>
> ==============================
>
>
>
>
> --
> Atenciosamente,
> *Diogo Borges Provete*
>
> ==============================
> Biólogo
> Mestre em Biologia Animal (UNESP)
> Laboratório de Ecologia Animal
> Departamento de Zoologia e Botânica
> Instituto de Biociências, Letras e Ciências Exatas
> Universidade Estadual Paulista - UNESP
> São José do Rio Preto-SP
> Brazil
>
> Rua Cristóvão Colombo, 2265
> Jardim Nazareth -  15054-000
>
> *Skype*: diogoprovete
> *MSN*: diogoprov at yahoo.com.br
>
> *Personal web page <https://sites.google.com/site/diogoprovetepage/>*
>
> Traduza conosco:
> <<<American Journal Experts>>> <http://www.journalexperts.com/br/>
> <<<D-Lang  Soluções linguisticas<
> http://www.d-lang.com.br/site/sitept/index.htm>
> >>>
>
> ==============================
>
>        [[alternative HTML version deleted]]
>
>
> ______________________________________________
> 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.
>
>

        [[alternative HTML version deleted]]


More information about the R-help mailing list