News for hackers. Stuff that matters.
Re:The Truth About Linear Regression (2015) by nextos on Tuesday July 30, 2024 @02:39PM (#41112671)
If you add a multilevel structure to shrink your (generalized) linear predictors, this framework becomes incredibly powerful.

There are entire statistics textbooks devoted to multilevel linear models, you can get really far with these.

Shrinking through information sharing is really important to avoid overly optimistic predictions in the case of little data.

Re:The Truth About Linear Regression (2015) by aquafox on Tuesday July 30, 2024 @03:28PM (#41113226)
If you like shrinkage (I do), I highly recommend the work of Matthew Stephens, e.g. ashr [1] and vash [2] for shrinkage based on an empirically derived prior.

[1] https://cran.r-project.org/web/packages/ashr/index.html [2] https://github.com/mengyin/vashr

Re:The Truth About Linear Regression (2015) by nextos on Tuesday July 30, 2024 @03:57PM (#41113492)
Yes, the article linked to ashr is quite famous.
Re:The Truth About Linear Regression (2015) by levocardia on Tuesday July 30, 2024 @06:59PM (#41114960)
Especially when you use the mixed model (aka MLM) framework to automatically select the smoothing penalty for your splines. So in one simple and very intuitive framework, you can estimate linear and nonlinear effects, account for repeated measurements and nested data, and model binary, count, or continuous outcomes (and more), all fitting the model in one shot, yielding statistically valid confidence intervals and p-values.

R's mgcv package (which does all of the above) is probably the single reason I'm still using R as my primary stats language.

Re:The Truth About Linear Regression (2015) by stevesimmons on Wednesday July 31, 2024 @02:35AM (#41116849)
Is there a Python eqivalent?
Re:The Truth About Linear Regression (2015) by gpderetta on Wednesday July 31, 2024 @08:11AM (#41118523)
statsmodels is the closest thing in python to R. statsmodels has mixed model support, but mgcv apparently requires more. It is well above my paygrade, but this seems relevant: https://github.com/statsmodels/statsmodels/issues/8029 (i.e. no out of the box support, you might be able to build an approximation on your own).