0

I am a python person, and am having trouble working with a for loop. I have a list representing the names of particular columns in a dataframe containing colums (Sample_Name_Column, ComparisonColumn, MeasureA, MeasureB, MeasureC, MeasureD) which I want to use for a linear mixed effects model (using the nlme library). So I wrote a simple loop to try and do that:

list <- c("MeasureA","MeasureB","MeasureC","MeasureD")
for (i in list){
  model = lme(i ~ ComparisonColumn, random=~1|Sample_Name_Column, 
  data=sampleDataSheet, method="REML")
}

but of course this fails.

Error in model.frame.default(formula = ~i + ComparisonColumn + Sample_Name_Column,  :   variable lengths differ (found for 'ComparisonColumn')

The function lme doesn't expand the variable; is looking for a column i as the input. Yet other functions like print() or length() do. Odd. Anyway, I've found some posts that use .asformula and reformulate here but I'm having an awful lot of trouble getting it working.

for (i in groupList) {
model = lme(as.formula(paste0(i, " ~ ComparisonColumn, random=~1|Sample_Name_Column")), data=sampleDataSheet, method="REML")
}

I get a little further (because the iterable has been correctly inserted):

Error in parse(text = x, keep.source = FALSE) : 
  <text>:1:26: unexpected ','
1: MeasureA ~ ComparisonColumn,
                               ^

but something is wrong here too.

I should add that running the model directly works:

model = lme(MeasureA ~ ComparisonColumn, random=~1|Sample_Name_Column, 
data=sampleDataSheet, method="REML")

Linear mixed-effects model fit by REML
  Data: 
sampleDataSheet
Log-restricted-likelihood: -462.6646
Fixed: MeasureA ~ ComparisonColumn
(Intercept)      ComparisonColumnTreatmentA 
 0.81377249 -0.08312908 

Random effects:
 Formula: ~1 | Sample_Name_Column
        (Intercept)  Residual
StdDev:   0.1800545 0.5348801
Number of Observations: 564
Number of Groups: 16 

I've gotten a bit of the way, but can some kind soul please help me out to finish it off?

thanks, K

2 Answers 2

1

as.formula alone seems not fit to your need, beacause you ave two formulas.

Look at this example, and compare fm1 and fm2 results, it may help you :

fm1 <- lme(distance ~ age + Sex, data = Orthodont, random = ~ 1)

params <- list(fixed = reformulate(c("age", "Sex"), response =  "distance"),
           random = reformulate("1"),
           data = Orthodont)

fm2 <- do.call(lme,params)
Sign up to request clarification or add additional context in comments.

3 Comments

thanks. this seems to get me part of the way there, but behaviour of some functions is odd when I do this.. I'll post an answer below to illustrate.
I think it's not a big issue, because each model is a structured objet, from witch you can get any information you need, for example : fm2$coefficients will give you coefficients .. you can study the structure of the object with str(fm2) ... and so you can easily build a data.frame with just the information you need, and you can also add in this data.frame names for the data used ..
Another way is to force a little the ouptut object .. from my example you can compare fm1 and fm2 by all.equal(fm1, fm2) and see that the difference lies in the component call. So by modifying the fm2$call you may obtain the same output ..
0

I think MrSmithGoesToWashington has got me almost there. The code I'm now using is:

library(lsmeans)
library(multcomp)
library(nlme)

groupList = c("MeasureA","MeasureB","MeasureC","MeasureD")

for (i in groupList){
 print(i)

 # following MrSmithGoesToWashington's example
 params = list(fixed = reformulate("ComparisonColumn", response = i), random = reformulate("1|Sample_Name_Column"), data = sampleDataSheet, method="REML")
 model = do.call(lme,params)

 anova.lme(model, type="sequential", adjustSigma = FALSE)
 posthoc = glht(model, linfct=mcp(ComparisonColumn="Tukey"))

 Multiple_Comparisons_of_Means = summary(posthoc, sampleDataSheet=adjusted("single-step"))

 print(Multiple_Comparisons_of_Means)
}

But there's some weirdness about how the data from sampleDataSheet is being interpreted.

Without looping, the model variable prints as:

> model
Linear mixed-effects model fit by REML
  Data: test 
  Log-restricted-likelihood: -2961.527
  Fixed: MeasureD ~ ComparisonColumn 
       (Intercept) ComparisonColumnNP 
      1.924292e+02       7.532103e-03 

Random effects:
 Formula: ~1 | Sample_Name_Column
        (Intercept) Residual
StdDev:    21.12601  45.3235

Number of Observations: 564
Number of Groups: 16 

but in the loop, the way params is handled by the do.call function, the data frame prints in its entirety as a "structure"; it prints as (once it has iterated the loop to "MeasureD"):

> model
Linear mixed-effects model fit by REML
  Data: structure(list(Sample_Name_Column = structure(c(10L, 10L, 11L,  10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L,  10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L,  10L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L,  11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L,  11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L,  11L, 11L, 11L, 11L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L,  9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L,  9L, 9L, 9L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L,  12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L,  12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L,  13L, 13L, 13L, 13L, 13L, 13L, 13L, 13L, 13L, 13L, 13L, 13L, 13L,  13L, 13L, 13L, 13L, 13L, 13L, 13L, 13L, 13L, 13L, 13L, 13L, 13L,  13L, 13L, 13L, 13L, 13L, 13L, 13L, 13L, 13L, 13L, 14L, 14L, 14L,  14L, 14L, 14L, 14L, 14L, 14L, 14L, 14L, 14L, 14L, 14L, 14L, 14L,  14L, 14L, 14L, 14L, 14L, 14L, 14L, 14L, 14L, 14L, 14L, 14L, 14L,  14L, 14L, 14L, 14L, 14L, 14L, 14L, 15L, 15L, 15L, 15L, 15L, 15L,  15L, 15L, 15L, 15L, 15L, 15L, 15L, 15L, 15L, 15L, 15L, 15L, 15L,  15L, 15L, 15L, 15L, .....), .Label = c("A.2",  "A.3", "A.4", "A.5",  "A.7", "A.4", "A.6", "A.8",  "B.10", "B.8", "B.9",  "B.3", "B.4", "B.5", "B.6",  "B.7"), class = "factor"), ComparisonColumn = structure(c(2L,  2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L,  2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L,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135L, 130L, 145L, 131L,  175L, 99L, 148L, 173L, 115L, 196L, 227L, 208L, 139L, 278L, 234L,  148L, 109L, 233L, 167L, 151L, 141L, 122L, 106L, 120L, 140L, 266L,  226L, 277L, 198L, 237L, 162L, 203L, 201L, 192L, 237L, 230L, 221L,  182L, 184L, 298L, 191L, 240L, 210L, 250L, 186L, 187L, 229L, 230L,  206L, 293L, 182L, 218L, 209L, 171L, 152L, 279L, 324L, 122L, 132L,  223L, 250L, 155L, 189L, 206L, 213L, 233L, 215L, 95L, 164L, 213L,  188L, 273L, 284L, 206L, 185L, 209L, 176L, 136L, 190L, 214L, 240L,  231L, 190L, 211L, 165L, 246L, 236L, 244L, 265L, 160L, 220L, 203L,  186L, 110L, 181L, 180L, 264L, 159L, 151L, 179L, 144L, 187L, 144L,  280L, 280L, 295L, 214L, 217L, 246L, 184L, 204L, 200L, 223L, 192L,  226L, 209L, 146L, 209L, 181L, 223L, 196L, 226L, 147L, 191L, 180L,  154L, 162L, 170L, 174L, 144L, 230L, 155L, 197L, 228L, 196L, 166L,  182L, 169L, 192L, 206L, 117L, 133L, 127L, 193L, 156L, 140L, 267L,  234L, 280L, 181L, 230L, 169L, 192L, 166L, 182L, 140L, 244L, 201L,  230L, 168L, 159L, 152L, 211L, 195L, 125L, ..... 202L, 295L, 188L, 103L, 104L,  168L, 229L, 210L, 163L, 228L, 231L, 143L, 164L)), .Names = c("Sample_Name_Column",  "ComparisonColumn", "MeasureA", "MeasureB", "MeasureC", "MeasureD" ), class = "data.frame", row.names = c(NA, -564L)) 
  Log-restricted-likelihood: -2961.527
  Fixed: MeasureD ~ ComparisonColumn 
       (Intercept) ComparisonColumnNP 
      1.924292e+02       7.532103e-03 

Random effects:
 Formula: ~1 | Sample_Name_Column
        (Intercept) Residual
StdDev:    21.12601  45.3235

Number of Observations: 564
Number of Groups: 16 

This has repercussions on the output of the multiple comparisons of means, which outputs the whole data frame rather than the dataFrame name. It's not a huge issue, but it's messy.

> summary(Multiple_Comparisons_of_Means)

     Simultaneous Tests for General Linear Hypotheses

Multiple Comparisons of Means: Tukey Contrasts


Fit: lme.formula(fixed = MeasureD ~ ComparisonColumn, data = list(
    Sample_Name_Column = c(10L, 10L, 11L, 10L, 10L, 10L, 10L, 
    10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 
    10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 11L, 
    11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 
    11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 
    11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 
    11L, 11L, 11L, 11L, 11L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 
    9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 
    9L, 9L, 9L, 9L, 9L, 9L, 9L, 12L, 12L, 12L, 12L, 12L, 12L, 
    12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, 
    3L, 3L, 3L, 3L, 3L), ComparisonColumn = c(2L, 2L, 2L, 2L, 
    2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 
    2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 
    2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 
    2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 
    2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 
    2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 
    2L, 2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, 197L, 
    278L, 252L, 191L, 165L, 240L, 202L, 221L, 225L, 167L, 235L, 
    249L, 231L, 219L, 273L, 185L, 221L, 150L, 180L, 282L, 216L, 
    128L, 255L, 161L, 152L, 90L, 154L, 153L, 135L, 130L, 145L, 
    131L, 175L, 99L, 148L, 173L, 115L, 196L, 227L, 208L, 139L, 
    278L, 234L, 148L, 109L, 233L, 167L, 151L, 141L, 122L, 106L)), random = ~1 | Sample_Name_Column, 
    method = "REML")

Linear Hypotheses:
              Estimate Std. Error z value Pr(>|z|)
NP - LP == 0  0.007532  11.238300   0.001    0.999
(Adjusted p values reported -- single-step method)

Any ideas how to fix that? Otherwise it's working. Thanks.

1 Comment

I now understand that using something like: Multiple_Comparisons_of_Means$test$pvalues[1] will give me the information I need.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.