search for: lm3

Displaying 20 results from an estimated 25 matches for "lm3".

Did you mean: lm
2012 Dec 18
3
Regression line does not show on scatterplot
Hello, I have done a scatterplot and now would like to add its regression line but it does not show. Below, the code I have used. lm3 <- lm(data$S_pH_KCl2.5_BCx~data$B_OleicoPF_BCx_per) plot(data$S_pH_KCl2.5_BCx, data$B_OleicoPF_BCx_per) abline(lm3) I have been able to do the complete operation using the software STATISTICA but it would be great to do it with R. If you require more details please get in touch. Thanks a lot!...
2008 Jun 19
4
Problems with lm()
...1,1,2,2,1,1,2,2,1,1,2,2,1,1,2,2,1,1) e<-c(1739,1633,1481,1837,1780,2073,1374,1629,1555,1385,1756,1522,1566,1643,1939,1615,1475,1759,1388,1483,1127,1682,1542,1247,1235,1605,1598,1718 ) Data<-data.frame(subject=as.factor(a), drug=as.factor(b), period=as.factor(c), sequence=as.factor(d), Max=e) lm3<- lm(Max ~subject*sequence + sequence + period + drug, data=Data) print(lm3) anova(lm3) When I use lm to fit the data, there are some problems in ?subject*sequence?. I have use GLM in SPSS to fit the same data, and it seems there is no problem. I don?t know where my problem is. How can I g...
2005 Jun 29
1
poly() in lm() leads to wrong coefficients (but correct residuals)
Dear all, I am using poly() in lm() in the following form. 1> DelsDPWOS.lm3 <- lm(DelsPDWOS[,1] ~ poly(DelsPDWOS[,4],3)) 2> DelsDPWOS.I.lm3 <- lm(DelsPDWOS[,1] ~ poly(I(DelsPDWOS[,4]),3)) 3> DelsDPWOS.2.lm3 <- lm(DelsPDWOS[,1]~DelsPDWOS[,4]+I(DelsPDWOS[,4]^2)+I(DelsPDWOS[,4]^3)) 1 and 2 lead to identical but wrong results. 3 is correct. Surprisingly (t...
2008 Nov 24
3
Is this correct?
...uss the relationship between taking part in sports, GPA, and income for these data. The R code I used so far is Does sports predict GPA? > lm1<-lm(GPA~sports) > summary(lm1) Does sports predict income? > lm2<-lm(income~sports) > summary(lm2) Does GPA predict income? > lm3<-lm(income~GPA) > summary(lm3) Does sports predict income after accounting for GPA? > lm4<-lm(income~GPA+sports) > summary(lm4) Can someone let me know is the above is correct? I am not sure if to keep all four regressions or only 1 and 4. Also, I need to plot the data on a graph...
2014 Jun 13
3
p values con LMER
...ón puede utilizarse con el pvalor de esa variable. Por ejemplo: Lm1=lmer(rt_ln ~ (fre_ln * Z_nsize * frebase_ln + (1|word), data = x) Lm2= lmer(rt_ln ~ (Z_nsize * frebase_ln + (1|word), data = x) anova(Lm1,Lm2, test="Chisq") #Obtiens el pvalor de la variable ?fre_ln?   Lm3=lmer(rt_ln ~ (fre_ln * frebase_ln + (1|word), data = x) anova(Lm1,Lm3, test="Chisq") #Obtiens el pvalor de la variable ? Z_nsize?   Espero que te sea de utilidad, Un saludo Manuel El 13 de junio de 2014, 12:25, Miguel Lázaro <lazarolv en yahoo.es> escribió: Hol...
2003 Oct 28
1
error message in simulation
...m14<-c(1:nitns) for(itn in 1:nitns){ g<-rbinom(nsims,1,0.5) b<-rnorm(nsims,0,1)*10 rn<-rnorm(nsims,0,1)*10 a<-b*r+rn*(1-r^2)^0.5 a<-round(a)+50 a<-a-g*5 b<-round(b)+50 abs.2<-function(x) ifelse(x<1,1,x) b<-abs.2(b) c<-b-a p<-c/b lm1<-lm(a~g) lm2<-lm(c~g) lm3<-lm(p~g) lm4<-lm(a~b+g) gr<-c(g,g) occasion<-rep(0:1,c(nsims,nsims)) occ<-occasion-0.5 ppd<-c(b,a) h<-rep(0,nsims) mb<-mean(b) bppd<-b-mb bappd<-c(h,bppd) occgr<-occ*gr subject<-c(1:nsims) sub<-c(subject,subject) library(nlme) lm5<-lme(ppd~occ+gr+occgr,rand...
2007 Nov 29
1
Anova(car) SS digits
Hi, When I use Anova(car) to produce type III SS, 'Sum Sq' is reported in integers: > Anova(bot.lm3, type ="III") Anova Table (Type III tests) Response: bottemp Sum Sq Df F value Pr(>F) (Intercept) 45295 1 29436.4440 < 2e-16 fungroup 3 2 0.8259 0.44006 numsp.fun 11 2 3.4503 0.03460 b...
2012 Jul 06
2
Anova Type II and Contrasts
...ically linear and or quadratic. I found out that the following code produces the same p-value for Observation as the Anova() function. However, the result also does not include any p-values for the linear or quadratic effect: lm2 <- lm(log(Variable) ~ Observation + COV1 + COV2, data = df1) lm3 <- lm(log(Variable) ~ COV1 + COV2, data = df1) anova(lm2, lm3) Does anybody know how to conduct a Type II anova and the contrasts function to obtain the p-values for the linear and quadratic effects? Help would be very much appreciated. Best Peter [[alternative HTML version deleted]]
2014 Jun 13
2
p values con LMER
Hola a todos, quería preguntaros un medio para obtener los valores p usando lmer. He tratado con pvals.fnc, que es lo que me habían recomendado, pero por algún motivo no está ya disponible etc. Ésta es la función que tengo, pero da las "t", sin los valores p. Aunque Baayen indica que valores por encima de 2 son significativos necesito saber las p. resultado = lmer(rt_ln ~ (fre_ln *
2014 Jun 13
3
p values con LMER
...t; > data = x) > > > > Lm2= lmer(rt_ln ~ (Z_nsize > > * frebase_ln + (1|word), data = > > x) > > > > anova(Lm1,Lm2, > > test="Chisq") #Obtiens el pvalor de > > la variable "fre_ln" > > > > > > > > Lm3=lmer(rt_ln ~ (fre_ln * > > frebase_ln + (1|word), data = x) > > > > anova(Lm1,Lm3, > > test="Chisq") #Obtiens el pvalor de > > la variable " Z_nsize" > > > > > > > > Espero que te sea de > > utilidad, > > &g...
2012 Jan 13
2
Help needed in interpreting linear models
...y well. Hence, the R-squared value is close to 1. For the second example it also makes sense that the p-value is almost 1 (p=0.9221) as there is hardly any correlation between scores and height. What is not clear to me is shown in my 3rd linear model which includes both weight and height. > (lm3 <- summary(lm(scores ~ weight + height))) Call: lm(formula = scores ~ weight + height) Residuals: 1 2 3 4 5 6 1.189e+00 -1.946e+00 -2.165e-15 4.865e-01 -1.081e+00 1.351e+00 Coefficients: Estimate Std. Error t value Pr(>...
2010 Jul 07
3
Large discrepancies in the same object being saved to .RData
...## 3. delete all objects in function call stack > lmtest3 <- lmfunc(add = TRUE, gr = TRUE) > gc() used (Mb) gc trigger (Mb) max used (Mb) Ncells 210766 5.7 467875 12.5 467875 12.5 Vcells 3615863 27.6 6933688 52.9 6898609 52.7 > save(lmtest3, file = "lm3.RData") > system("ls -s lm3.RData") 320 lm3.RData ## A minimal increase in Vcells; .RData object is now 320Kb > sapply(ls(pattern = "lmtest*"), function(x) object.size(get(x, envir = .GlobalEnv))) lmtest1 lmtest2 lmtest3 358428 358428 358428 ## all obj...
2000 Jul 12
2
Removing Objects from workspace
Hi all, how can I remove objects from the workspace which starts with a certain pattern, e.g. lm (lm1, lm2, lm3 etc). Wildcards won?t work. Thanks, Sven -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not t...
2007 Sep 05
3
'singular gradient matrix’ when using nls() and how to make the program skip nls( ) and run on
Dear friends. I use nls() and encounter the following puzzling problem: I have a function f(a,b,c,x), I have a data vector of x and a vectory y of realized value of f. Case1 I tried to estimate c with (a=0.3, b=0.5) fixed: nls(y~f(a,b,c,x), control=list(maxiter = 100000, minFactor=0.5 ^2048),start=list(c=0.5)). The error message is: "number of iterations exceeded maximum of
2006 Sep 03
2
lm, weights and ...
> lm2 <- function(...) lm(...) > lm2(mpg ~ wt, data=mtcars) Call: lm(formula = ..1, data = ..2) Coefficients: (Intercept) wt 37.285 -5.344 > lm2(mpg ~ wt, weights=cyl, data=mtcars) Error in eval(expr, envir, enclos) : ..2 used in an incorrect context, no ... to look in Can anyone explain why this is happening? (Obviously this is a manufactured example, but it
2006 Mar 16
2
DIfference between weights options in lm GLm and gls.
...lm glm and gls? I try the following codes, but the results are different. > lm1 Call: lm(formula = y ~ x) Coefficients: (Intercept) x 0.1183 7.3075 > lm2 Call: lm(formula = y ~ x, weights = W) Coefficients: (Intercept) x 0.04193 7.30660 > lm3 Call: lm(formula = ys ~ Xs - 1) Coefficients: Xs Xsx 0.04193 7.30660 Here ys= y*sqrt(W), Xs<- sqrt(W)*cbind(1,x) So we can see weights here for lm means the scale for X and y. But for glm and gls I try > glm1 Call: glm(formula = y ~ x) Coefficients: (Intercept)...
2010 Jan 12
0
[Solved][Code Snippets] Dropping Empty Regressors
...mcReg # in which one of the newmcReg happen to be all true or false. # # God I wish I had taken more then a Trig course. Where was I? # # Yes that phantom 'i' you see is that this is all in a big loop # for 6 possible models # lm1 = all regressors w/ intercept # lm2 = lm1 stepwise removal # lm3 = all regressors wo/ intercept # lm4 = lm3 stepwise removal # lm5 = Hand Tuned # lm6 = lm5 stepwise removal ################################################### toPurge=c() for(k in names(newmcReg[[i]])) { print (paste("check to see if",k,"is a useless regressors for model",i))...
2007 Jul 17
1
Speed up computing: looping through data?
...these individually against the explanatory variables, is there a way to 'group' all response and explanatory variables and then look at all the linear relationship amongst all these variables? I have tried: my.group1 <- c(a,b,c,d,e,f,g,h,i,j) my.group2 <- c(k,l,m,n,o,p,q,r,s,t) my.lm3 <- lm(my.group1 ~ my.group2) to no avail. Thanks for your help, Andy
2011 Oct 17
1
plotting issues with PCA
...1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,5,4,4,4,4,4,3,3,3,6,6,6,6,6,6,6,6,5,5,5,5) > names(site.codings) <- c( "WM1", "WM2", "WM3", "NM1", "NM2", "NM3", "KH1", "KH2", "KH3", "LM1" ,"LM2" ,"LM3", "DB1" ,"DB2" ,"DB3", "DM1" , "DM2" , "DM3" , "FI1", "FI2", "BKI1", "BKI2", "BKO1", "BKO2", "BKO3", "SUR1","MI1","MI2","MI3&qu...
1997 Aug 18
1
R-beta: bug report
...7.8887 [10,] 201.3 24.01 317.8470 [11,] 203.6 25.14 322.4460 [12,] 204.6 26.57 327.9783 [13,] 209.5 28.49 334.9553 [14,] 208.6 27.76 332.3596 [15,] 210.7 29.04 336.8674 [16,] 211.9 29.88 339.7189 [17,] 212.2 30.06 340.3195 > lm3 Call: lm(formula = log.pressure ~ boil.pt, subset = c(-12)) Coefficients: (Intercept) boil.pt -95.176624 2.051855 > forbes.pred boil.pt 190 190 200 200 > predict(lm3,newdata=forbes.pred) Error in if (object$intercept) X <- cbind(rep(...