Displaying 20 results from an estimated 6000 matches similar to: "Extract r.squared using cbind in lm"
2012 Sep 08
1
Using predict() After Adding a Factor to a glm.nb() Model
# Hello,
# I have a data set that looks something like the following:
site<-c(rep('a',5),rep('b',2),rep('c',4),rep('d',11))
year<-c(1980, 1981, 1982, 1993, 1995, 1980, 1983, 1981, 1993, 1995,
1999, c(1980:1990))
count<-c(60,35,36,12,8,112,98,20,13,15,15,65,43,49,51,34,33,33,33,40,11,0)
data<-data.frame(site, year, count)
# > site year count
# 1
2007 Dec 13
4
please explain find_with_ferret, retrieve_records, :include and :conditions
Hello, I''m using find_with_ferret to search multiple models and it
works great. The trouble is I need to filter the results
using :include and :conditions.
I get two errors depending on the syntax I use in the search. Reading
the source, I see the retrieve_records method seems to filter
the :include and :conditions so that they only apply to the relevant
model when searching
2010 Jan 22
4
Extract R-squared from summary of lm
Dear all,
I cannot find to explicitly get the R-squared or adjusted R-squared from
summary(lm())
Thanks a lot!
[[alternative HTML version deleted]]
2010 Jan 29
3
extract R-squared and P-value from lm results
Hi, R Users
I find a problem in extracting the R-squared and P-value from the lm results
described below (in Italic),
*Residual standard error: 2.25 on 17 degrees of freedom*
*Multiple R-squared: 0.001069, Adjusted R-squared: -0.05769 *
*F-statistic: 0.01819 on 1 and 17 DF, p-value: 0.8943 *
*
*
Any suggestions will be appreciated. Thanks.
Wenjun
[[alternative HTML version deleted]]
2006 Aug 25
1
R.squared in Weighted Least Square using the Lm Function
Hello all,
I am using the function lm to do my weighted least
square regression.
model<-lm(Y~X1+X2, weight=w)
What I am confused is the r.squared.
It does not seem that the r.squared for the weighted
case is an ordinary 1-RSS/TSS.
What is that precisely?
Is the r.squared measure comparable to that obtained
by the ordinary least square?
<I also notice that
model$res is the unweighted
2004 Jul 22
1
Bug: wrong R-squared in lm formula w/o intercept (PR#7127)
Full_Name: Adriano Azevedo Filho
Version: 1.9.1
OS: Windows, Linux
Submission from: (NULL) (200.171.246.212)
R-squared and Adjusted R-squared appear to be wrong when
the formula in lm() is specified without intercept. Problem
present in both Windows and Linux 1.9.1 version. Also
in the 1.8.1 version for Windows (other versions not
checked).
Possible example which reproduces the problem:
2005 Apr 18
1
R-squared in summary(lm...)
What is the difference between the two R-squareds returned for a linear
regression by summary(lm...)? When might one report multiple vs. adjusted
R-squared?
Thank you,
Ben Osborne
--
Botany Department
University of Vermont
109 Carrigan Drive
Burlington, VT 05405
benjamin.osborne at uvm.edu
phone: 802-656-0297
fax: 802-656-0440
2011 Mar 04
1
linear model - lm (Adjusted R-squared)?
Hi,
Sorry for the naive question, but what exactly does the 'Adjusted R-squared'
coefficient in the summary of linear model adjust for?
Sample code:
> x <- rnorm(15)
> y <- rnorm(15)
> lmr <- lm(y~x)
> summary(lmr)
Call:
lm(formula = y ~ x)
Residuals:
Min 1Q Median 3Q Max
-1.7828 -0.7379 -0.4485 0.7563 2.1570
Coefficients:
2010 Oct 05
2
R squared for lm prediction
Hi all,
I have used a hold out sample to predict a model but now I want to compute
an R squared value for the prediction. Any help is appreciated.
Best regards
--
View this message in context: http://r.789695.n4.nabble.com/R-squared-for-lm-prediction-tp2955328p2955328.html
Sent from the R help mailing list archive at Nabble.com.
2013 Jan 28
2
Adjusted R-squared formula in lm()
What is the exact formula used in R lm() for the Adjusted R-squared? How can I interpret it?
There seem to exist several formula's to calculate Adjusted R-squared.
Wherry’s formula [1-(1-R2)·(n-1)/(n-v)]
McNemar’s formula [1-(1-R2)·(n-1)/(n-v-1)]
Lord’s formula [1-(1-R2)(n+v-1)/(n-v-1)]
Stein 1-(n-1/n-k-1)(n-2)/n-k-2) (n+1/n)
Theil's formula (found here:
2011 Dec 15
2
lm and R-squared (newbie)
Hello,
I've two data.frames (data1 and data4), dec="." and sep=";".
http://r.789695.n4.nabble.com/file/n4199964/data1.txt data1.txt
http://r.789695.n4.nabble.com/file/n4199964/data4.txt data4.txt
When I do
plot(data1$nx,data1$ny, col="red")
points(data4$nx,data4$ny, col="blue")
, results seem very similar (at least to me) but the R-squared of
2016 Apr 07
0
R.squared in summary.lm with weights
Do you mean w <- z$residuals ?
Type names(z) to see the list of item in your model.
I ran your code on a lm and it work fine.
You don't need the brackets around mss <-
Michael Long
On 04/07/2016 02:21 PM, Murray Efford wrote:
> Following some old advice on this list, I have been reading the code for summary.lm to understand the computation of R-squared from a weighted
2005 Sep 25
1
Question on lm(): When does R-squared come out as NA?
I have a situation with a large dataset (3000+ observations), where
I'm doing lags as regressors, where I get:
Call:
lm(formula = rj ~ rM + rM.1 + rM.2 + rM.3 + rM.4)
Residuals:
1990-06-04 1994-11-14 1998-08-21 2002-03-13 2005-09-15
-5.64672 -0.59596 -0.04143 0.55412 8.18229
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -0.003297 0.017603
2016 Apr 08
0
R.squared in summary.lm with weights
On 07/04/2016 5:21 PM, Murray Efford wrote:
> Following some old advice on this list, I have been reading the code for summary.lm to understand the computation of R-squared from a weighted regression. Usually weights in lm are applied to squared residuals, but I see that the weighted mean of the observations is calculated as if the weights are on the original scale:
>
> [...]
> f
2002 May 03
1
R-squared in lm
Dear all,
I'm puzzled by the definition of r-squared used by 'lm' when the model is
without intercept.
The help for summary says:
>r.squared: R^2, the ``fraction of variance explained by the model'',
>
> R^2 = 1 - Sum(R[i]^2) / Sum((y[i]- y*)^2),
>
> where y* is the mean of y[i] if there is an intercept and
> zero
2016 Apr 07
4
R.squared in summary.lm with weights
Following some old advice on this list, I have been reading the code for summary.lm to understand the computation of R-squared from a weighted regression. Usually weights in lm are applied to squared residuals, but I see that the weighted mean of the observations is calculated as if the weights are on the original scale:
[...]
f <- z$fitted.values
w <- z$weights
[...]
m
2016 Apr 08
2
R.squared in summary.lm with weights
On 08 Apr 2016, at 12:57 , Duncan Murdoch <murdoch.duncan at gmail.com> wrote:
> On 07/04/2016 5:21 PM, Murray Efford wrote:
>> Following some old advice on this list, I have been reading the code for summary.lm to understand the computation of R-squared from a weighted regression. Usually weights in lm are applied to squared residuals, but I see that the weighted mean of the
2007 Oct 18
5
R-squared value for linear regression passing through origin using lm()
Hi,
A have small technical question about the calculation of R-squared
using lm().
In a study case with experimental values, it seems more logical to
force the regression line to pass through origin with lm(y ~ x +0).
However, R-squared values are higher in this case than when I
compute the linear regression with lm(y ~ x).
It seems to be surprising to me: is this result normal ? Is there
2016 Apr 09
2
R.squared in summary.lm with weights
>>>>> Murray Efford <murray.efford at otago.ac.nz>
>>>>> on Fri, 8 Apr 2016 18:45:33 +0000 writes:
> Thanks for these perfectly consistent replies - I didn't
> understand the purpose of m = sum(w * f/sum(w)) and saw it
> merely as a weighted average of the fitted values. My
> ultimate concern is how to compute an appropriate
2010 Jan 08
2
how to get perfect fit of lm if response is constant
Hello.
Consider the response-variable of data.frame df is constant, so analytically
perfect fit of a linear model is expected. Fitting a regression line using
lm result in residuals, slope and std.errors not exactly zero, which is
acceptable in some way, but errorneous. But if you use summary.lm it shows
inacceptable error propagation in the calculation of the t value and the
corresponding