Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options not deleted user 31313

Use this tag for any *on-topic* question that (a) involves `R` either as a critical part of the question or expected answer, & (b) is not *just* about how to use `R`.

5 votes

Mathematical Notation for Mixed Effect Model with no Intercept

The model lmer(Y ~ 0 + A + B + C + (0 + B | A) does indeed have three fixed effects and a single random slope. I would write this model (using a vectorized notation) as $$ Y = \beta_{a} A + (\beta_b …
JTH's user avatar
  • 1,063
1 vote

Should binom.test to be used to test that the coins are fair in R? If not, what test should ...

I have a different way of looking at the problem. I think you can use binom.test here, but you have not invoked the command correctly. You should use x = 214 (the number of heads observed in the exper …
JTH's user avatar
  • 1,063
0 votes
Accepted

Question about the nlme setup/syntax R for nested repeated observations regression R

lme fits linear mixed models, not non-linear ones. For certain types of non-linear mixed models, you can use nlme. If area is nested in the levels of id, you can use the code model = lme(dv ~ inte …
JTH's user avatar
  • 1,063
2 votes
Accepted

Why are variables in GLM being split into multiple output variables

Gene is a factor with three levels. You can confirm this by checking levels(factor(data$gene)). The reference level is rolled into the intercept term, and the coefficients corresponding to the other t …
JTH's user avatar
  • 1,063
1 vote

If R were reprogrammed from scratch today, what changes would be most useful to the statisti...

Add more protected names pi <- 3 should probably not be allowed.
7 votes

If R were reprogrammed from scratch today, what changes would be most useful to the statisti...

Bring data.table like syntax to data.frame data.table's syntax (DT[i, j, by]) is so useful and such a faithful extension of data.frame that it should just be built in at this point. (If we are willing …
6 votes
0 answers
211 views

How does R's aov function 'work better' with orthogonal contrasts?

The help page for R's aov function states: The default ‘contrasts’ in R are not orthogonal contrasts, and aov and its helper functions will work better with such contrasts: see the examples for how to …
JTH's user avatar
  • 1,063
3 votes
Accepted

R: anova(lm) anova(lm, lm2) interaction term result different?

The default optimization criterion of lme is restricted maximum likelihood (REML). REML is not compatible with likelihood ratio tests. You need to refit your models with maximum likelihood, method = " …
JTH's user avatar
  • 1,063