Re: [R] se's and CI's for fitted lines in multivariate regression analysis

2012-10-20 Thread Sigrid
Hi again, Thank you so much for the script. Unfortunately, I feel like I might not have explained things clearly enough from the start. What I’m looking for is the st. errors or CI intervals for the estimate the parameter for slope and intercept for each level of each factor. From the summary

Re: [R] se's and CI's for fitted lines in multivariate regression analysis

2012-10-20 Thread David Winsemius
On Oct 16, 2012, at 11:58 AM, Sigrid wrote: Okay, I've now tried to the predict function and get the SE, although it seem to calculate SE for each observation from the line (I assume), while I want the CI-interval and SE for each line fitted line for the treatment. I do not really understand

Re: [R] se's and CI's for fitted lines in multivariate regression analysis

2012-10-17 Thread Rui Barradas
Hello, Thinking again, there are better ways of getting all the CI's for the fitted lines in one go. First, make a list of models, subsetting on each level of treatment. Then lapply predict.lm to the list of models. levs - levels(OrchardSprays$treatment) model.lst - lapply(levs,

Re: [R] se's and CI's for fitted lines in multivariate regression analysis

2012-10-16 Thread Sigrid
Okay, I've now tried to the predict function and get the SE, although it seem to calculate SE for each observation from the line (I assume), while I want the CI-interval and SE for each line fitted line for the treatment. I do not really understand what parameter mean these SEs are calculated

Re: [R] se's and CI's for fitted lines in multivariate regression analysis

2012-10-16 Thread Rui Barradas
Hello, If you want confidence intervals for the beta coefficients of the model, try the following. ci_lm - function(object, level = 0.95){ sfit - summary(object) beta - sfit$coefficients[, 1] se - sfit$coefficients[, 2] df - sfit$df[1] alpha - 1 - level lower - beta +

[R] se's and CI's for fitted lines in multivariate regression analysis

2012-10-10 Thread Sigrid
I’m entirely stumped on this particular issue and really hoping someone has some advice for me. I am running a covariant model in lm I would like to give the standard errors or the confidence intervals for the fitted lines. I’ve been using the dataset OrangeSprays where I want lines for each

Re: [R] se's and CI's for fitted lines in multivariate regression analysis

2012-10-10 Thread Bert Gunter
?predict Have you read An Inrtroduction to R? -- Bert On Wed, Oct 10, 2012 at 6:49 AM, Sigrid s.stene...@gmail.com wrote: I’m entirely stumped on this particular issue and really hoping someone has some advice for me. I am running a covariant model in lm I would like to give the standard

Re: [R] se's and CI's for fitted lines in multivariate regression analysis

2012-10-10 Thread Sigrid
Hi Bert, I just looked at An Introduction to R - and I do apologize if my questions are trivial. I see that they use predict as a function in lm, but I'm not sure how to incorporate it into a command. Thank you, S -- View this message in context:

Re: [R] se's and CI's for fitted lines in multivariate regression analysis

2012-10-10 Thread Rui Barradas
Hello, Your model is equivalent to the model below. As for standard errors, try predict.lm with the appropriate argument. ?predict.lm model - lm(decrease ~ rowpos + colpos*treatment, data = OrchardSprays) predict(model, se.fit = TRUE, interval = confidence) Hope this helps, Rui Barradas Em