Inconsistent b0 in linear regression between Jamovi and R

Discuss statistics related things

by uab » Tue Nov 19, 2019 7:36 pm

I agree with nadia and jRafi. It is definitely a weird thing to have the grand mean as the intercept whenever there's a factor in the model. Makes jamovi basically useless for teaching regression basics.
uab
 
Posts: 2
Joined: Tue Nov 19, 2019 7:22 pm

by jonathon » Tue Nov 19, 2019 11:20 pm

yeah, i think this might be one of those "damned if we do, damned if we don't" situations.

when computing the sums-of-squares, and the significance, the model used uses the grand mean as the intercept (in spss too). so it's weird to provide parameter estimates that are from a completely different model (i.e. one that uses one of the levels as an intercept, which is what spss does).

i agree (as a stats teacher myself), there's something nice about teaching a model where a reference level is the intercept ... but the fact that that *isn't* the model that SPSS is using to calculate the sums-of-squares, etc. makes me feel like i'm misleading my students.

is it time we started teaching the grand mean? it doesn't seem like such a stretch.

jonathon
User avatar
jonathon
 
Posts: 986
Joined: Fri Jan 27, 2017 10:04 am

by jRafi » Fri Nov 29, 2019 2:02 pm

Thanks for keeping us updated Jonathon, appreciate your thoughts here.

Although I am certainly not qualified to take a stance regarding if the intercept should be the grand mean or a reference level, I find it highly problematic that the model intercepts you get from jamovi differs from both R and SPSS.

I've introduced jamovi to several people, and everyone enjoys the simplicity and user-friendliness. However, if jamovi gives different results than other software (not only SPSS), then we have an issue with the validity of the results. This might scare people away from jamovi if they find the results untrustworthy.

I understand your view about the grand mean as an intercept, but the question is whether it is worth taking a (imo) radical stance here if hurts credibility and adoption?
jRafi
 
Posts: 5
Joined: Fri Feb 15, 2019 9:08 pm
Location: Stockholm

by jonathon » Sun Dec 01, 2019 9:52 am

i don't think our results differ from R ... only SPSS. it seems to me that SPSS does something very quirky and misleading here, and i'm reluctant to perpetuate that.

jonathon
User avatar
jonathon
 
Posts: 986
Joined: Fri Jan 27, 2017 10:04 am

by jRafi » Sun Dec 01, 2019 7:15 pm

the lm() function in R uses a reference level as the intercept.

Consider the following data:
data.frame(
    y = c(9,10,11, 20,20,20),
    z = c(rep("a", 3), rep("b", 3)))

In R, using lm() the intercept is 10.
In jamovi, the intercept is 15.
jRafi
 
Posts: 5
Joined: Fri Feb 15, 2019 9:08 pm
Location: Stockholm

by jonathon » Mon Dec 02, 2019 5:14 am

yeah ok, but if you use the anova() function, it uses the grand mean as the intercept.

which is part of what's challenging here ... there's quite a confusing legacy. i like the fact that our ANOVA and linear regression produce consistent results ... that makes a heck of a lot of sense to me. but perhaps we need to revisit it.

at the very least, i do want to add a dummy coding option to the linear regression.

jonathon
User avatar
jonathon
 
Posts: 986
Joined: Fri Jan 27, 2017 10:04 am

by uab » Tue Dec 03, 2019 5:19 pm

Thanks for your effort, Jonathon. Indeed, adding a dummy coding option to linear regression would be great!
uab
 
Posts: 2
Joined: Tue Nov 19, 2019 7:22 pm

by jRafi » Fri Dec 06, 2019 9:52 am

Again, thanks for sharing your thoughts on this Jonathon. I see your point in having the ANOVA and linear regression producing consistent intercepts. Also look forward to the update where you could set the intercept in a regression analysis as a reference level.
jRafi
 
Posts: 5
Joined: Fri Feb 15, 2019 9:08 pm
Location: Stockholm

Previous

Return to Statistics

cron