[R] isSingular for lm?
pd@|gd @end|ng |rom gm@||@com
Fri Apr 5 13:22:06 CEST 2019
Can't you just check for NA coefficients?
> y <- rnorm(10) ; x <- rep(0,10)
I have a vague recollection that at some point there might have been dragons lurking in there (? - NA coefs silently removed), but I can't see a problem with it presently.
> On 5 Apr 2019, at 12:14 , Witold E Wolski <wewolski using gmail.com> wrote:
> lme4 has a function isSingular to check if the fitted model is Singular,
> Although lm has the parameter singular.ok = TRUE by defualt, I could
> not find a function to check if the fitted model is singular.
> What would be the correct way to implement such a function for and lm object?
> Check if df.residuals == 0
> Witold Eryk Wolski
> R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
Peter Dalgaard, Professor,
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Office: A 4.23
Email: pd.mes using cbs.dk Priv: PDalgd using gmail.com
More information about the R-help