[R] glmmLasso with interactions errors

Walker Pedersen wsp at uwm.edu
Wed Jul 13 22:20:06 CEST 2016


Hi Everyone,

I am having trouble running glmmLasso.

An abbreviated version of my dataset is here:

https://drive.google.com/open?id=0B_LliPDGUoZbVVFQS2VOV3hGN3c

Activity is a measure of brain activity, Novelty and Valence are
categorical variables coding the type of stimulus used to elicit the
response, ROI is a categorical variable coding three regions of the
brain that we have sampled this activity from, and STAIt is a
continuous measure representing degree of a specific personality trait
of the subjects. Subject is an ID number for the individuals the data
was sampled from.

Before glmmLasso I am running:

KNov$Subject <- factor(KNov$Subject)

to ensure the subject ID is not treated as a continuous variable.

If I run:

glm1 <- glmmLasso(Activity~as.factor(Novelty) + as.factor(Valence) +
STAIt + as.factor(ROI)
+ as.factor(Valence):as.factor(ROI), list(Subject=~1), data = KNov, lambda=10)
summary(glm1)

I don't get any warning messages, but the output contains b estimates
only, no SE or p-values.

If I try to include a 3-way interaction, such as:

glm2 <- glmmLasso(Activity~as.factor(Novelty) + as.factor(Valence) +
STAIt + as.factor(ROI)
+ as.factor(Novelty):as.factor(Valence):as.factor(ROI),
list(Subject=~1), data = Nov7T, lambda=10)
summary(glm2)

I get the warnings:

Warning messages:
1: In split.default((1:ncol(X))[-inotpen.which], ipen) :
  data length is not a multiple of split variable
2: In lambda_vec * sqrt(block2) :
  longer object length is not a multiple of shorter object length

And again, I do get parameter estimates, and no SE or p-values.

If I include my continuous variable in any interaction, such as:

glm3 <- glmmLasso(Activity~as.factor(Novelty) + as.factor(Valence) +
STAIt + as.factor(ROI)
+ as.factor(Valence):as.factor(ROI) + as.factor(Novelty):STAIt,
list(Subject=~1), data = Nov7T, lambda=10)
summary(glm3)

I get the error message:

Error in rep(control$index[i], length.fac) : invalid 'times' argument

and no output.

If anyone has an input as to (1) why I am not getting SE or p-values
in my outputs (2) the meaning of there warnings I get when I include a
3-way variable, and if they are something to worry about, how to fix
them and (3) how to fix the error message I get when I include my
continuous factor in an interatction, I would be very appreciative.

Thanks!

Walker



More information about the R-help mailing list