search for: lmmodel

Displaying 7 results from an estimated 7 matches for "lmmodel".

Did you mean: cmmodel
2012 May 03
1
NA's when subset in a dataframe
Dear community, I'm having this silly problem. I've a linear model. After fixing it, I wanted to know which data had studentized residuals larger than 3, so i tried this: d1 <- cooks.distance(lmmodel) r <- sqrt(abs(rstandard(lmmodel))) rstu <- abs(rstudent(lmmodel)) a <- cbind( mydata, d1, r,rstu) alargerthan3 <- a[rstu >3, ] And suddenly a[rstu >3, ] has 17 rows, 7 of them are "new rows", where all the entries are NA's, even its rownames. Because of thi...
2016 Apr 29
2
lm() with spearman corr option ?
...data = data, mapping = mapping) + geom_point(color = I("blue")) + geom_smooth(method = "lm", color = I("black"), ...) + theme_blank() + theme(panel.border=element_rect(fill=NA, linetype = "solid", color="black")) lmModel <- eval(substitute(lm(y ~ x, data = data), mapping)) fs <- summary(lmModel)$fstatistic pValue <- pf(fs[1], fs[2], fs[3], lower.tail = FALSE) if (pValue < 0.05) { p <- p + theme( panel.border = element_rect( color = "red",...
2008 Aug 05
1
Extracting variable names of final model in stepAIC
Hello there. I uses the following codes for the purpose of variable selection. > lmModel <- lm(y~.,data.frame(y=y, x=x)) > step <- stepAIC(lmModel, direction="both") > step$anova Stepwise Model Path Analysis of Deviance Table Initial Model: y ~ x.Market.Price + x.Quantity + x.Country + x.Incoterm + x.Channel + x.PaymentTerm Final Mode...
2011 Nov 16
2
outlier identify in qqplot
Dear Community, I want to identify outliers in my data. I don't know how to use identify command in the plots obtained. I've gone through help files and use mahalanobis example for my purpose: NormalMultivarianteComparefunc <- function(x) { Sx <- cov(x) D2 <- mahalanobis(x, colMeans(x), Sx) plot(density(D2, bw=.5), main="Squared Mahalanobis distances, n=nrow(x),
2013 Mar 27
1
lmer, p-values and all that
Dear Help: I am trying to follow Professor Bates' recommendation, quoted by Professor Crawley in The R Book, p629, to determine whether I should model data using the 'plain old' lm function or the mixed model function lmer by using the syntax anova(lmModel,lmerModel). Apparently I've not understood the recommendation or the proper likelihood ratio test in question (or both) for I get this error message: Error: $ operator not defined for this S4 class. Would someone be kind enough to point out my blunder? Thank you, Michael Grant [[alternati...
2012 Nov 01
2
Name assignment in for loop
Dear helpeRs- I'm using a for loop to create a series of models. I'm trying to assign a name to each model created, using the loop index. The loop gets stuck at the name of the model, giving the error "target of assignment expands to non-language object". The linear model runs without error; only the name is problematic. Here is the current loop syntax. The use of dat
2002 Nov 22
3
simple test on slope of lm()
Hello I want to compare the slope (let's say 'b') of a linear model obtained with lm() to a theoretical value (let's say 'th'). To do so, I think I should compute a 't value' using something like : (b - 'th')/standard.deviation(b) and then look at the p-value of this computed t. I don't understand how to do this in a simple way, just using lm()