Skip to content

multivariate analysis

3 messages · Rosario Garcia Gil, Kjetil Halvorsen

#
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:

            
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

  
  
#
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.
#
if you want linear models (not specified), something like this should work:

Put your 1800 response variables (as columns) in a nx1800 matrix
resp_mat, and then
lm(resp_mat ~ latitude*age)   # interactions
lm(resp_mat ~ latitude+age   # without interactions

Kjetil

On Fri, Nov 26, 2010 at 9:01 PM, Rosario Garcia Gil
<M.Rosario.Garcia at genfys.slu.se> wrote: