r commands

  1. C

    Example of lmer() function in R documentation .

    How is the following code working ? (fm1 <- lmer(angle ~ recipe * temperature + (1|recipe:replicate), cake, REML= FALSE)) In the formula of lmer : What does 1 before vartical bar , (1|recipe:replicate) , indicate ? How does "recipe:replicate" after vartical bar work ? I...
  2. C

    How to compute the residual standard deviation from `glmer()` function in R?

    I want to extract standard deviation of residual from `glmer()` function in R . So I wrote : lmer_obj = glmer(Y ~ X1 + X2 + (1|Subj), data = D, family = binomial) sigma(lmer_obj) I noticed that the last command `sigma(lmer_obj)` returns always "1" irrespective of data ...
  3. H

    Resampling in R

    Hi I want to generate two sets of random numbers and see how many times the same number appears in both columns. In R I have been using the code length(intersect(sample(1:369, 51, rep=F), sample(1:369,13, rep=F))) I would like to replicate this 1000 times, each time with a new set of random...