0
$\begingroup$

I have been studying a linguistic construction (let’s call it C) in a language L1 trying to individuate several factors (F1, F2, ..., Fn) which can influence / trigger the presence of C in L1. All factors are categorical variables with several levels.

I ran basic significance tests (Goodness of fit) which revealed a high level of significance for each factors involved.

That said, I would now like to measure the interaction of all factors / all levels. As for the method, I think that Poisson Regression is what I am looking for since “C” has no levels and can be represented in terms of frequencies. I thus tried Poisson regression in R but I have soon run into several problems.

I have two questions in particular:

  1. The data frame I used looked like that (here you can find only a tiny part of it as an example):

    Subj (Factor1)   NP (F2)    New (F3)    EXP_CON (F4)
    

    To get the frequencies of all variable combinations, I used the function ftable and then I went on manually computing the frequencies. Needless to say, it was a painful procedure and it took a lot of time!

    Does R provide an easier and quicker way to get the frequencies for all the interacting factors / levels (possibly eliminating automatically the interactions whose frequency is zero)? In other words, I would like to obtain something like that:

    Sub (F1)     NP (F2)      EXP_CON (F3)         New (F4)        (Freq) 6
    
  2. After that, I tried to run a Poisson regression model but the result was puzzling. Here is an example of what I got:

    Syn_FunOther:Focus_CCIMP_CON:IS_CCGiven        NA         NA      NA       NA
    Syn_FunSub:Focus_CCIMP_CON:IS_CCGiven          NA         NA      NA       NA
    Syn_FunOther:Focus_CCNO_CON:IS_CCGiven         NA         NA      NA       NA
    Syn_FunSub:Focus_CCNO_CON:IS_CCGiven           NA         NA      NA       NA
    Syn_FunOther:Focus_CCNOV:IS_CCGiven            NA         NA      NA       NA
    

I do not really understand. Why are there so many NA values?

$\endgroup$
2
$\begingroup$

First, you could skip the whole cross-tabulating business and just fit a logistic regression of C on F1 to Fn where C is TRUE or 1 when it's present and FALSE or 0 when it's not.

Now, I don't really understand what your data look like from the description, but assuming you have a data frame dat with columns named C, F1, F2 and F3 representing your subjects (or whatever), a reasonable starting model might be

mod <- glm(C ~ F1 + F2 + F3, family=binomial, data=dat)

A full set of interactions would be fitted if you replaced each + with a *. That's not clearly a good idea (how to interpret it?) Also, it won't work if some combinations of values of F1, F2 and F3 contain no subjects. When that happens, you'll get an NA estimate, as you do.

This is actually the right answer because glm uses ML to estimate the model and there is simply no information about the relationship between C and subjects with some particular combination of Fs. This applies also to any regression you might run too fitted this way.

If you want to shrink the values of F together then you'll need to apply some random effects assumptions. For that, lme4 is probably your package.

$\endgroup$
  • 2
    $\begingroup$ you mean glm(C ~ F1 + F2 + F3, family=binomial, data=dat), lm() is only for when you assume normal errors $\endgroup$ – Corey Sparks Jul 14 '14 at 19:35
  • $\begingroup$ quite right - well caught :-) $\endgroup$ – conjugateprior Jul 15 '14 at 7:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.