similar to: interpreting "not defined because of singularities" in lm

Displaying 20 results from an estimated 10000 matches similar to: "interpreting "not defined because of singularities" in lm"

2003 May 30
2
Coefficients: (20 not defined because of singularities)
Hello, I am trying to run a linear regression analysis on my data set. For some reason most variables are removed due to singularities. My linear regression looks this way (I am using only partial data, which is selected by flags): fm<-lm(log(cplex6.time..sec..[flags]) ~ cplex6.cities[flags] + log(1/features.meanOver.frust[flags]) + log(1/features.meanOver.minDist[flags]) + [...]
2008 Feb 14
2
lm, coefficient 'not defined because of singularities'? What does this mean?
Hello, I'm doing an lm(y1~x1), no NAs in them, both of length 283. I get out however and 'NA' for the estimate of x1 and summary gives: Residuals: Min 1Q Median 3Q Max -0.1998309 -0.0447269 -0.0006252 0.0390933 0.3141687 Coefficients: (1 not defined because of singularities) Estimate Std. Error t value Pr(>|t|) (Intercept) -0.021291 0.003994 -5.331 2.01e-07 *** x1
2010 Aug 29
2
glm prb (Error in `contrasts<-`(`*tmp*`, value = "contr.treatment") : )
glm(A~B+C+D+E+F,family = binomial(link = "logit"),data=tre,na.action=na.omit) Error in `contrasts<-`(`*tmp*`, value = "contr.treatment") : contrasts can be applied only to factors with 2 or more levels however, glm(A~B+C+D+E,family = binomial(link = "logit"),data=tre,na.action=na.omit) runs fine glm(A~B+C+D+F,family = binomial(link =
2011 Dec 05
1
Summary coefficients give NA values because of singularities
Hello, I have a data set which I am using to find a model with the most significant parameters included and most importantly, the p-values. The full model is of the form: sad[,1]~b_1 sad[,2]+b_2 sad[,3]+b_3 sad[,4]+b_4 sad[,5]+b_5 sad[,6]+b_6 sad[,7]+b_7 sad[,8]+b_8 sad[,9]+b_9 sad[,10], where the 9 variables on the right hand side are all indicator variables. The thing I don't understand
2009 Jan 23
1
Interpreting model matrix columns when using contr.sum
With the following example using contr.sum for both factors, > dd <- data.frame(a = gl(3,4), b = gl(4,1,12)) # balanced 2-way > model.matrix(~ a * b, dd, contrasts = list(a="contr.sum", b="contr.sum")) (Intercept) a1 a2 b1 b2 b3 a1:b1 a2:b1 a1:b2 a2:b2 a1:b3 a2:b3 1 1 1 0 1 0 0 1 0 0 0 0 0 2 1 1 0 0 1 0
2005 Jun 30
2
Finding out collinearity in regression
Hi, I am trying to find out a collinearity in explanatory variables with alias(). I creat a dataframe: dat <- ds[,sapply(ds,nlevels)>=2] dat$Y <- Response Explanatory variables are factor and response is continuous random variable. When I run a regression, I have the following error: fit <- aov( Y ~ . , data = dat) Error in "contrasts<-"(`*tmp*`, value =
2006 Nov 26
1
GLM and LM singularities
Hi- I'm wrestling with some of my data apparently not being called into a GLM or an LM. I'm looking at factors affecting fish annual catch rates (ie. CPUE) over 30 years. Two of the factors I'm using are sea surface temperature and sea surface temperature anomaly. A small sample of my data is below: CPUE Year Vessel_ID Base_Port Boat_Lgth Planing SST Anomaly 0.127
2011 Dec 24
1
Nested model - "singularities not defined"
I am using a nested model in R and the lm output shows 47 not defined because of singularities and I have no idea why. Any help on why this is happening or how to fix this problem would be very much appreciated. Below is the output I received from R. Thanks and happy holidays! Call: lm(formula = Dist ~ Treatment/SiteL/Territory) Residuals: Min 1Q Median 3Q Max -6.646 -1.443
2000 Mar 20
3
lm handling of ill-conditioned systems
The lm() function in R seems to handle the inversion of singular X'X matrices (where there is collinearity between regression inputs) in a way where one of the inputs is dropped and this also seems to be the default behavior in SAS (please let me know if i'm wrong about this). In some other packages (i.e. octave ols() function) the pseudo inverse is computed where singular values less
2010 Mar 31
2
interpretation of p values for highly correlated logistic analysis
Dear list, I want to perform a logistic regression analysis with multiple categorical predictors (i.e., a logit) on some data where there is a very definite relationship between one predicator and the response/independent variable. The problem I have is that in such a case the p value goes very high (while I as a naive newbie would expect it to crash towards 0). I'll illustrate my problem
2007 May 17
1
model.matrix bug? Nested factor yields singular design matrix.
Hi all, I believe this is a bug in the model.matrix function. I'd like a second opinion before filing a bug report. If I have a nested covariate B with multiple values for just one level of A, I can not get a non-singular design matrix out of model.matrix > df <- data.frame(A = factor(c("a", "a", "x", "x"), levels = c("x",
2006 May 11
2
greco-latin square
Hi, I am analyzing a repeated-measures Greco-Latin Square with the aov command. I am using aov to calculate the MSs and then picking by hand the appropriate neumerator and denominator terms for the F tests. The data are the following: responseFinger mapping.code Subject.n index middle ring little ---------------------------------------------------------------------------- 1 1
2002 Apr 09
1
how to deal with singularities in lm()
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 I got the report Coefficients: (1 not defined because of singularities) while trying to get my model's coefficients from lm() What shall I do to avoid it and get the one missing coefficient? Thank you. lukas - -- Lukas Kubin lukas.kubin at permonik.com phone: 00420603836180 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.5 (GNU/Linux)
2009 Feb 26
4
Singularity in a regression?
R friends, In a matrix of 1s and 0s, I'm getting a singularity error. Any helpful ideas? lm(formula = activity ~ metaF + metaCl + metaBr + metaI + metaMe + paraF + paraCl + paraBr + paraI + paraMe) Residuals: Min 1Q Median 3Q Max -4.573e-01 -7.884e-02 3.469e-17 6.616e-02 2.427e-01 Coefficients: (1 not defined because of singularities)
2010 Aug 12
3
Regression Error: Otherwise good variable causes singularity. Why?
This command cdmoutcome<- glm(log(value)~factor(year) > +log(gdppcpppconst)+log(gdppcpppconstAII) > +log(co2eemisspc)+log(co2eemisspcAII) > +log(dist) > +fdiboth > +odapartnertohost > +corrupt > +log(infraindex) > +litrate > +africa >
2001 Jun 15
1
contrasts in lm and lme
I am using RW 1.2.3. on an IBM PC 300GL. Using the data bp.dat which accompanies Helen Brown and Robin Prescott 1999 Applied Mixed Models in Medicine. Statistics in Practice. John Wiley & Sons, Inc., New York, NY, USA which is also found at www.med.ed.ac.uk/phs/mixed. The data file was opened and initialized with > dat <- read.table("bp.dat") >
2005 Jul 22
1
find confounder in covariates
Hi, I was wondering if there is a way, or function in R to find confounders. For istance, > a = sample( c(1:3), size=10,replace=T) > X1 = factor( c('A','B','C')[a] ) > X2 = factor( c('Aa','Bb','Cc')[a] ) > Xmat = data.frame(X1,X2,rnorm(10),rnorm(10)) > dimnames(Xmat)[[2]] = c('z1','z2','z3','y') Now,
2004 Apr 25
1
ts's in lm()
Is this a bug? seasonal.dummies <- function(x, contr=NULL) { # takes a time series and returns a matrix of seasonal dummies for # x. This is almost cycle(x), we only have to make it into a factor # and add suitable level names. # return a matrix which includes a constant! # level names here assumes frequency is 12! cyc <- factor( cycle(x), labels=c("ene","feb",
2003 Oct 23
3
List of lm objects
Hi R-Helpers: I?m trying to fit the same linear model to a bunch of variables in a data frame, so I was trying to adapt the codes John Fox, Spencer Graves and Peter Dalgaard proposed and discused yesterday on this e-mail list: for (y in df[, 3:5]) { mod = lm(y ~ Trt*Dose, data = x, contrasts = list(Trt = contr.sum, Dose = contr.sum)) Anova(mod, type = "III") } ## by John Fox or for
2003 Feb 16
0
[SUMMARY] Converting coef(lm) to SQL/VBA/etc
Many thanks to all who helped with my question last week about how to take the output of lm() and turn it into code that can be run on systems without R (using SQL, C, etc). This is a summary of the answers, caveats, and a solution including a little Perl script I wrote to do this. Brian Ripley pointed out an important caveat to this whole process - the model.matrix could contain R functions that