Displaying 20 results from an estimated 9000 matches similar to: "Extract R-squared from summary of lm"
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]]
2010 Feb 03
3
diagnostic plots
Dear all,
does anybody ever encountered the problem with diagnostic plots?
x<-rnorm(100)
y<-rnorm(100)
plot(lm(x~y))
It gives the following message "Waiting to confirm page change..." and
nothing happens.
Thanks a lot!
[[alternative HTML version deleted]]
2010 Jan 13
4
<= returns wrong result? Why
Dear all,
Does anybody know the probable reason why <= gives false when it should give
true?
These two variables are of the same type, and everything works in the cycle
but then it stops when they are equal.
this is the output result
> Rk[47] <= RB[21]
[1] FALSE
> Rk[47]
[1] 0.002842007
> RB[21]
[1] 0.002842007
Thanks a lot.
[[alternative HTML version deleted]]
2010 Jul 09
3
strange floor rounding
Dear all,
might seem and easy question but I cannot figure it out.
floor(100*(.58))
[1] 57
where is the trick here? And how can I end up with the right answer?
Thanks a lot everybody for your help.
Trafim
[[alternative HTML version deleted]]
2010 Jul 14
4
reverse string
Dear all,
Are there any functions in R to reverse the order of the string.
smth like reverse("abc") to get "cba"?
Thanks a lot.
[[alternative HTML version deleted]]
2010 Jan 14
3
plot type any symbols?
Dear all,
I have a question is there a possibility to plot points with different
symbols like stars, crosses?
I looked at different types for plot command and didn't find anything like
that.
Thanks a lot.
[[alternative HTML version deleted]]
2010 Jan 07
2
Graph titles from massive
Dear all,
I would like to ask you if there is a possibility in R to give the names to
graphs which are not const.
For example,
How to name each plot, or to add notes like a=x[i], b=y[i] in this cycle
x<-c(1,2,3,4,5,6)
y<-c(7,8,9,10,11,12)
par(mfrow=c(2,3))
for (i in 1:6){
plot(x,y)
}
Thank you for your time and help!
[[alternative HTML version deleted]]
2010 Mar 01
1
Fitting chi-squared distribution
Dear all,
I have a question regarding performing test if the data fits chi-squared
distribution.
For example, using ks.test()
I found in the examples how to fit it to gamma or weibull
x<-rnorm(100)
ks.test(x, "pweibull", shape=2,scale=1)
for the gamma, pgamma can be used
But I cannot find the value of this second parameter for the chi-squared
distribution.
Maybe someone
2010 Sep 09
1
createDataPartition
Dear all,
does anyone know how to define the structure of the required samples using
function createDataPartition, meaning proportions of different types of
variable in the partition?
Smth like this for iris data:
createDataPartition(y = c(setosa = .5, virginica = .3, versicolor = .2),
times = 10, p = .7, list = FALSE)
Thanks a lot for your help.
Regards,
Trafim
[[alternative HTML version
2010 Aug 16
1
lm prediction strange error
Dear all,
I have an error in the simple prediction function for lm().
Maybe someone experienced the same?
xma <- matrix(data = 0, nrow = 100, ncol = 2)
xma[, 1] <- rnorm(100)
xma[, 2] <- rchisq(100, df = 3)
m1 <- lm(xma[, 1] ~ xma[, 2])
predict(m1, as.data.frame(seq(-13, 13, 0.5)))
Thanks a lot,
Trafim
[[alternative HTML version deleted]]
2010 Jan 07
2
Extract p-value from linear model
Dear all,
I have the following question.
Is it possible in R to call for the p-value directly in a model like this
a <- c(4.81,4.17,4.41,3.59,5.87,3.83,6.03,4.89,4.32,4.69)
b <- c(4.17,5.58,5.18,6.11,4.50,4.61,5.17,4.53,5.33,5.14)
summary(lm(a~(b+0)))
or even in this
a <- c(4.81,4.17,4.41,3.59,5.87,3.83,6.03,4.89,4.32,4.69)
b <- c(4.17,5.58,5.18,6.11,4.50,4.61,5.17,4.53,5.33,5.14)
2010 Apr 05
3
Matrix elements are vectors
Dear all,
My question how is it possible to define a matrix A with 10 rows 1 column,
so that its elements are vectors of undefined length.
I need to have a possibility later to add elements like A[1,1] <-
c(A[1,1],3,4,5)
Thanks a lot for the help!
[[alternative HTML version deleted]]
2009 Dec 09
1
Bootstrapping in R
Dear all,
I have some error trying to bootstrap from a matrix. The error message is
"Error in sample(n, n * R, replace = TRUE) : element 2 is empty;
the part of the args list of '*' being evaluated was: (n, R)"
vv <- c(0.5,3.2,5.4,1.1,1.4,1.2,2.3,2.0)
Reg <- matrix(data=vv, nrow = 4, ncol = 2)
bootcoeff <- function(x){
coefficients(lm(x[,1]~x[,2]))[2]+1
}
2010 Sep 07
4
minor diagonal in R
Dear all,
seems that easy question but cannot find the function for that.
How to get the elements of the minor diagonal of the matrix?
Thanks a lot.
[[alternative HTML version deleted]]
2010 Jun 11
3
Calculation of r squared from a linear regression
Hi,
I'm trying to verify the calculation of coefficient of determination (r squared) for linear regression. I've done the calculation manually with a simple test case and using the definition of r squared outlined in summary(lm) help. There seems to be a discrepancy between the what R produced and the manual calculation. Does anyone know why this is so? What does the multiple r squared
2010 Feb 18
1
Shapiro-Wilk test problem
Hi everybody,
Does anyone know what problem may be with this test.
I am applying 5 different normality tests and use p-values for them, but for
some reason S-W gives me NA, while sample size is 100.
Any ideas?
Thanks a lot!
[[alternative HTML version deleted]]
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
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
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
2009 Dec 14
1
Printing to PDF in for
Hi everybody,
I would like to ask if it is possible using pdf function or some other to
print plots in cycle such that every new plot is on new page.
like this
pdf(file="D:/Plot.pdf",width = 9.25,height=9.25,
family="Helvetica",pointsize=8,bg="white")
for (i in 1:10){
x <- seq(1,40,1)
y <- 2*x+1+5*rnorm(length(x))
hist(y,freq = FALSE)
plot(density(y))
}