Page 1 of 1

in regression analysis, how can I make a model with intercept equal to 0? I have version 2.6.4 4

Posted: Wed Jun 25, 2025 7:03 pm
by d3bug
in previous versions, a checkbox appeared, now I can't find it...

Re: in regression analysis, how can I make a model with intercept equal to 0? I have version 2.6.4 4

Posted: Sun Jun 29, 2025 6:37 pm
by mcfanda@gmail.com
In gamlj3 you can estimate a regression model (GLM) without intercept (intercept =0). Obviously, how to interpret the results is completely up to you

Cheers

Re: in regression analysis, how can I make a model with intercept equal to 0? I have version 2.6.4 4

Posted: Mon Jun 30, 2025 11:57 am
by d3bug
Thank you for responding

I'm looking for a tool that can help me explain things to students who lack mathematical and especially programming skills. I've been using it, and the library you recommended calculates one parameter incorrectly. Also, when asked to recalculate the model without B0, it doesn't do it either

greetings

Re: in regression analysis, how can I make a model with intercept equal to 0? I have version 2.6.4 4

Posted: Sat Jul 05, 2025 12:07 am
by mcfanda@gmail.com
If you find something you believe is incorrect, please send a omv file where we can see where the error is (if any), and explain what the results should be, please

Re: in regression analysis, how can I make a model with intercept equal to 0? I have version 2.6.4 4

Posted: Mon Jul 07, 2025 9:34 am
by mcfanda@gmail.com
Hi
we have checked the module GAMLj3 (version 3.6.1) on the case you are referring to, but we did not find any of the issues you mentioned. You can test it using this simple dataset
q1.png
q1.png (8.18 KiB) Viewed 81430 times
Y variable has mean M=5 and variance v=7.5, N=9. Variable x has mean M=2.

When estimating a intercept-only model the module returns an intercept of 5, as expected, and SS=60, the latter being v*df=7.5*8.
q2.png
q2.png (17.81 KiB) Viewed 81430 times
When a 0 only model is estimated (uncheck "intercept" in the model panel), no parameter is estimated and the SS=285, which is exactly sum(y^2).

When x is inserted as predictor, the intercept is 5, because x is centered to its mean (as indicated in the note under the info table), so the intercept is the expected value for average x. Total SS is 60, as in the first model.
q3.png
q3.png (24.85 KiB) Viewed 81430 times
If 0 intercept is requested, with x as predictor, the model updates, and estimates only the slope. The total SS is again 285 as in the second model.

Re: in regression analysis, how can I make a model with intercept equal to 0? I have version 2.6.4 4

Posted: Mon Jul 07, 2025 9:40 am
by mcfanda@gmail.com
Finally, if you run a model with x not centered (Covariates scaling panel, select "original"), you get an intercept of 3, which is My-B*Mx=5-1*2=3 with correct slope=1.
q4.png
q4.png (15.02 KiB) Viewed 81422 times
A 0-intercept model for this setup yields a B=2.28 which is correctly the slope of the line that crosses the origin.
q5.png
q5.png (35.13 KiB) Viewed 81422 times