similar to: plotting confidence intervals of regression line

Displaying 20 results from an estimated 100 matches similar to: "plotting confidence intervals of regression line"

2004 Mar 08
2
getting the std errors in the lm function
Hello, I have a simple question for you: making: mylm<-lm(y~x) summary(mylm) I get the following results: ****************************************************** Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 16.54087 0.19952 82.91 <2e-16 *** x[1:19] -2.32337 0.04251 -54.66 <2e-16 *** ******************************************************
2010 Sep 14
1
NA confusion (length question)
Hi folks, I am running a very simple regression using mylm <- lm(mass ~ tarsus, na.action=na.exclude) I would like the use the residuals from this analysis for more regression but I'm running into a snag when I try cbind(mylm$residuals, mydata) # where my data is the original data set The error tells me that it cannot use cbind because the length of mylm$residuals is
2003 Oct 11
1
Subclassing lm
I'd trying to subclass the "lm" class to produce a "mylm" class whose instances behave like lm objects (are accepted by methods like summary.lm) but have additional data or slots of my own design. For starters: setClass("mylm", "lm") produces the somewhat cryptic: Warning message: Old-style (``S3'') class "mylm" supplied as a
2011 May 20
2
extraction of mean square value from ANOVA
Hello, I am randomly generating values and then using an ANOVA table to find the mean square value. I would like to form a loop that extracts the mean square value from ANOVA in each iteration. Below is an example of what I am doing. a<-rnorm(10) b<-factor(c(1,1,2,2,3,3,4,4,5,5)) c<-factor(c(1,2,1,2,1,2,1,2,1,2)) mylm<-lm(a~b+c) anova(mylm) Since I would like to use a loop to
2009 May 14
1
automated polynomial regression
Dear all - We perform some measurements with a machine that needs to be recalibrated. The best calibration we get with polynomial regression. The data might look like follows: > true_y <- c(1:50)*.8 > # the real values > m_y <- c((1:21)*1.1, 21.1, 22.2, 23.3 ,c(25:50)*.9)/0.3-5.2 > # the measured data > x <- c(1:50) > # and the x-axes > > # Now I do the following:
2006 Jan 16
4
Standardized beta-coefficients in regression
Hello list, I am used to give a lot of attention to the standardized regression coefficients, which in SPSS are listed automatically. Is there alternative to running the last two lines in the following example to get all the information? ctl <- c(4.17,5.58,5.18,6.11,4.50,4.61,5.17,4.53,5.33,5.14) trt <- c(4.81,4.17,4.41,3.59,5.87,3.83,6.03,4.89,4.32,4.69) summary( lm(ctl ~ trt) )
2009 Mar 31
1
using "substitute" inside a legend
Hello list, I have a linear regression: mylm = lm(y~x-1) I've been reading old mail postings as well as the plotmath demo and I came up with a way to print an equation resulting from a linear regression: model = substitute(list("y"==slope%*%"x", R^2==rsq), list(slope=round(mylm$coefficients[[1]],2),rsq=round(summary(mylm)$adj.r.squared, 2))) I have four models and I
2009 Jan 24
2
how to prevent duplications of data within a loop
Hi All, I had posted a question on a similar topic, but I think it was not focused. I am posting a modification that I think better accomplishes this. I hope this is ok, and I apologize if it is not. :) I am looping through variables and running several regressions. I have reason to believe that the data is being duplicated because I have been monitoring the memory use on unix. How can I avoid
2007 Apr 06
2
lm() intercept at the end, rather than at the beginning
Hi, I wonder if someone has already figured out a way of making summary(mylm) # where mylm is an object of the class lm() to print the "(Intercept)" at the last line, rather than the first line of the output. I don't know about, say, biostatistics, but in economics the intercept is usually the least interesting of the parameters of a regression model. That's why, say, Stata
2005 Jun 16
1
regressing each column of a matrix on all other columns
DeaR list I would like to predict the values of each column of a matrix A by regressing it on all other columns of the same matrix A. I do this with a for loop: A <- B <- matrix(round(runif(10*3,1,10),0),10) A for (i in 1:length(A[1,])) B[,i] <- as.matrix(predict(lm( A[,i] ~ A[,-i] ))) B It works fine, but I need it to be faster. I've looked at *apply but just can't
2007 Oct 30
1
Some matrix and sandwich questions
Dear R-help, I have a four-part question about regression, matrices, and sandwich package. 1) In the sandwich package, I would like to better understand the meat() function. >From the bread() documentation, for a simple OLS regression, bread() returns (1/n * X'X)^(-1) That is, for a simple regression (per the documentation on bread()): MyLM <- lm(y ~ x) bread(MyLM)
2009 Sep 20
3
plotting least-squares regression against x-axis
Hi, I want to plot the residuals of a least-squares regression. plot(lm(y~x), which=1) does this, but it plots the y-axis of my data on the x-axis of the residuals plot. That is, it plots the residual for each y-value in the data. Can I instead use the x-axis of my data as the x-axis of the residuals plot, showing the residual for a given x? Thanks! Jason Priem University of North
2011 Jul 11
4
Save generic plot to file (before rendering to device)
I am looking for a way to save a plot (graphics contents) to a file after the plot has been calculated but before it has been rendered. More specifically, assume that I made a plot that took a very long time to produce, I would like to save this plot to a generic file that I can later, on a different machine, render to either PDF, PNG, SVG using the usual R graphics devices, without recalculating
2011 Jul 11
4
Save generic plot to file (before rendering to device)
I am looking for a way to save a plot (graphics contents) to a file after the plot has been calculated but before it has been rendered. More specifically, assume that I made a plot that took a very long time to produce, I would like to save this plot to a generic file that I can later, on a different machine, render to either PDF, PNG, SVG using the usual R graphics devices, without recalculating
2008 Nov 28
1
save single image when using plot(lm(y~x))
Dear List! When I'm using "plot(lm(y~x))" R shows me 4 different plots. They pop-up individually by clicking on the graph. How can I save for example the 2nd plot? I've found a camera button that says "copy to the clipboard as a metafile" once you place the mouse pointer on it. I tried, though it's not working. Any other suggestions? Thanks!! Stefan
2007 Aug 16
4
Linear models over large datasets
I'd like to fit linear models on very large datasets. My data frames are about 2000000 rows x 200 columns of doubles and I am using an 64 bit build of R. I've googled about this extensively and went over the "R Data Import/Export" guide. My primary issue is although my data represented in ascii form is 4Gb in size (therefore much smaller considered in binary), R consumes about
2009 Feb 03
1
How to show variables used in lm function call?
Hello R users, I am new to R and am wondering if anyone can help me out with the following issue: I wrote a function to build ts models using different inputs, but when R displays the call for a model, I cannot tell which variables it is using because it shows the arguments instead of the real variables passed to the function. (e.g Call: lm(formula = dyn(dep ~ lag(dep, -1) + indep)) --->
2002 Jul 01
1
a little statistics help
Dear R-guRus: I am stuck with the following problem in R: Let's say i have a data.frame with columns X,Y & Z. X is a column of numbers, Y is a column of N factors "A", "B", "C", "D", etc and Z is a column of n factors "a", "b", "c", etc if i do MyLm<-lm(X~Y*Z - 1) i get all N coefficients for Y-factors, but only
2011 Dec 12
2
Automated Regressions
Hello R-Experts, I've got a question, concerning the automation of a number of regressions (lm) with the help of a loop (for i in ....). The situation is as follows (the code follows after that): I have my data in an access database. I have historical data for 2000 parts, for each of this parts I want to do a regression analysis, so I need to do 2000 regressions (just for one country, there
2004 Jul 30
1
Three-way ANOVA?
Hi, I'm a biologist, so please forgive me if my question sounds absurd! I have 3 parameters x1, x2, x3 and a response variable y.The sample size is 75. I tried to do the following: mylm<-lm(y~ x1 + x2 + x3, data="mydata") but i can only get stats from anova for the first 2 variables. The third comes up as NA. The degrees of freedom for the third variable are 0. Is there