Displaying 20 results from an estimated 8000 matches similar to: "R2 in lm function"
2009 Feb 28
3
Extract statistics from lm()
Hi, perhaps this question was answered previously however I could not find
them. My problem is how how to extract a particular statistic from the
result given by lm(). For e.g.
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)
group <- gl(2,10,20, labels=c("Ctl","Trt"))
weight <- c(ctl, trt)
>
2013 Feb 19
1
Small quirks in summary.(g)lm docs
Hi!
In R 3.0.0 from current SVN, ?summary.lm says:
> Value [...]
> df degrees of freedom, a 3-vector (p, n-p, p*), the last
> being the number of non-aliased coefficients.
?summary.glm says:
> df a 3-vector of the rank of the model and the number of residual
> degrees of freedom, plus number of non-aliased coefficients.
It seems to me that the description is reversed: p is
2011 Jul 11
2
lm: mark sample used in estimation
Hi all,
I wanted to mark the estimation sample: mark what rows (observations)
are deleted by lm due to missingness. For eg, from the original
example in help, I have changed one of the values in trt to be NA
(missing).
# code below
# ----
# original example
> 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)
#
2007 Nov 26
1
pass lm( ) a char vector as the variables to be included
Dear Everyone in list:
I am writing some codes to automate the process of
fitting linear models where the names of variables of
models are produced and stored in character vectors.
But I have problems to pass the vectors to the lm( )
because I don't know how to strip the quotation marks
automatically.
Here are the codes of the example of lm( ):
## Annette Dobson (1990) "An Introduction
2006 Jun 21
1
Extract information from the summary of 'lm'
Hi Everyone,
I just don't know how to extract the information I
want from the summary of a linear regression model
fitting.
For example, I fit the following simple linear
regression model:
results = lm(y_var ~ x_var)
summary(results) gives me:
Call:
lm(formula = y_var ~ x_var)
Residuals:
Min 1Q Median 3Q Max
-5.9859 -1.5849 0.4574 2.0163 4.6015
Coefficients:
2006 May 16
1
lm summary
Dear all,
Is there anybody who can help me to avoid scientific number in the summary of an lm model?
Here there is an example of a usual output of the lm model.
Thank you!
Guillermo
Example
summary(lm(promiscuity.Index~allK))
Call:
lm(formula = promiscuity.Index ~ allK)
Residuals:
Min 1Q Median 3Q Max
-1.67094 -0.13126 0.06703 0.19913 0.40673
Coefficients:
2010 Feb 05
3
Extract p-value from lm for the whole model
Dear all,
I would like to ask how to extract the p-value for the whole model from
summary(lm).
This didn't help a lot summary.lm
summary(lm(speed~dist, cars))
Thanks a lot!
[[alternative HTML version deleted]]
2005 Sep 29
5
Regression slope confidence interval
Hi list,
is there any direct way to obtain confidence intervals for the regression
slope from lm, predict.lm or the like?
(If not, is there any reason? This is also missing in some other statistics
softwares, and I thought this would be quite a standard application.)
I know that it's easy to implement but it's for
explanation to people who faint if they have to do their own
programming...
2008 Jul 16
1
Output design question
Dear R-helpers,
I was curious why the output of summary (and many other functions in
R) does not add a separator between the name of a factor and the label
of a level (e.g., in the example below, 'group Trt'). If the user had
lower case labels (e.g., 'trt'), the output would be particularly hard
to read.
ctl <- c(4.17,5.58,5.18,6.11,4.50,4.61,5.17,4.53,5.33,5.14)
trt
2008 Sep 26
2
ANOVA between & within variance
hi,
is there an option to calculate the 'within' & 'between' group variances
for a simple ANOVA (aov) model (2 groups, 1 trait, normally distr.) ?
or do I have to calculate them from the Sum Sq ?
thanks for your time and greetings,
gregor
--
Gregor Rolshausen
PhD Student; University of Freiburg, Germany
e-mail: gregor.rolshausen at biologie.uni-freiburg.de
tel. :
2005 Feb 17
2
dumping the summary of lm to a text file
Hello list,
I have a linear regression
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)
group <- gl(2,10,20, labels=c("Ctl","Trt"))
weight <- c(ctl, trt)
reg <- lm(weight ~ group)
sreg <- summary(reg)
and I would like to dump exactly what I see on the console with
2009 Sep 03
1
Export objects
<r-help@r-project.org>
Hi, R users,
How can I export an R object as a .txt file? As an example I have the result
from a regression and I need to save this object in a .txt file
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)
group <- gl(2,10,20, labels=c("Ctl","Trt"))
weight <- c(ctl,
2008 Dec 23
1
sorting regression coefficients by p-value
Hi,
Is there a way to get/extract a matrix of regression variable name, coefficient, and p values?
(for lm and glm; which can be sort by p value?)
thanks
Dhruv
[[alternative HTML version deleted]]
2008 Apr 25
2
Extracting coefficients' standard errors from linear model
Dear all,
Hope this question is not too trivial...
In order to correct standard errors from an estimation of a fixed
effects regression model y need to extract the vector of standard errors
of the coefficients of a simple linear model estimated using
lm(var1~var2+var3+var4)
Unfortunately I can't find out the corresponding function.
Thank you very much for your help.
Uli
--
Uli
2008 Jul 25
2
graphing regression coefficients and standard errors
Hello,
I am interested in plotting my regression analysis
results(regression coefficients and standard errors obtained through OLS and
Tobit models)
in the form of graphs.What is the best way to accomplish this? Thanks.
Murali Kuchibhotla
[[alternative HTML version deleted]]
2005 Jul 28
1
Displaying p-values in latex
Hi. I want to create a table in latex with regression coefficients and their
corresponding p-values. My code is below. How do I format the p-values so
that values less than 0.0001 are formated as <.0001 rather than just rounded
to 0.0000? Thank you.
model<-lm(y~x1+x2)
output<-summary(model)
output<-as.matrix(coefficients(output))
output<-format.df(ouput,cdec=c(2,2,2,4))
2010 Jul 14
1
Add Significance Codes to Data Frame
I was hoping that there might be some way to attach significance code like
the ones from summary.lm to a dataframe. Anyone know how to do something
like that. Here is the function i'd like to add that functionality to:
add1.coef <- function(model,scope,test="F",p.value=1,order.by.p=FALSE)
{
num <- length(model$coefficients)
add <- add1(model,scope,test=test)
sub <-
2007 Aug 31
2
Bugreport on integration of Sweave and latex beamer
I think I have isolated a problem with integration between Sweave and beamer.
Could you please see the file:
http://www.mayin.org/ajayshah/tmp/bugdemo.Rnw
Unfortunately, it uses some of my internal libraries, so you can't run
it. When I put it through Sweave, I get:
http://www.mayin.org/ajayshah/tmp/bugdemo.tex
which is, of course, a generic latex file which you can read and
2009 Oct 27
1
option to control the spac between columns in data frame
Hello,
I have a question regarding a way to control the appreance of output
exported by R
when I use capture.output( x, file = "Directory/file.txt") , I get a text
file which when I paste to a word file looks like the first table below.
The following table has its clumns spaced closely so when I paste it to a
word file it looks continuous. Is there any option in R to make the outputs
2014 May 10
2
Duda_TEST DE WALD
Hola a todos y todas,
Gracias por vuestro apoyo en cantidad de preguntas anteriores, de nuevo os
escribo para compartir una duda:
Estoy trabajando con un modelo bien sencillo, es una regresión simple, pero
me gustaría comprobar la significación estadística de cada uno de los
coeficientes de regresión en el modelo. La idea es hacer un contraste de
hipótesis.
Me he descargado el paquete