Displaying 20 results from an estimated 1200 matches similar to: "R looping help"
2002 May 09
4
Rsquared in summary(lm)
Hello,
I'm doing some linear regression:
>lm<-lm(osas~alp,data)
>summary(lm)
However, the Rsquared in the output of summary() is not the same as the
"standard" Rsquared calculated by spreadsheets, and outlined in
statistical guidebooks, being SSR/SSTO. The output says "multiple
Rsquared", but it is no multiple regression...
What's the difference?
Thanks,
2002 May 11
2
Bug on Mac version of lm()?
Dear Mac users,
Hi, as you might have probably read the thread of
"[R] Rsquared in summary(lm)" on May 10, it seems that Mac version of
lm() seem to be working incorrectly.
I enclose the script to produce the result both for lm() and manual
calculation for a simple regression. Could you run the script and
report with the version of R, so I don't have to go through every
builds
2004 Jul 01
2
R can't find some functions in assist package
Oh yes. The "load package" under the "packages menu" in the Windows version
does that. To check I typed "library(assist)" after starting R. Same
behavior, ssr is found, but others like predict.ssr, and plot.ssr, give a
"not found" message.
Thanks for the suggestion.
Mike
2012 Nov 13
1
About systemfit package
Dear friends,
I have written the following lines in R console wich already exist in pdf
file systemfit:
data( "GrunfeldGreene" )
library( "plm" )
GGPanel <- plm.data( GrunfeldGreene, c( "firm", "year" ) )
greeneSur <- systemfit( invest ~ value + capital, method = "SUR",
+ data = GGPanel )
greenSur
I have obtained the following incomplete
2012 Nov 16
2
R-Square in WLS
Hi,
I am fitting a weighted least square regression and trying to compute
SSE,SST and SSReg but I am not getting SST = SSReg + SSE and I dont know
what I am coding wrong. Can you help please?
xnam <-colnames(X) # colnames Design Matrix
fmla1 <- as.formula(paste("Y ~",paste(xnam, collapse=
2010 Feb 27
1
Newbie help with ANOVA and lm.
Would someone be so kind as to explain in English what the ANOVA code (anova.lm) is doing? I am having a hard time reconciling what the text books have as a brute force regression and the formula algorithm in 'R'. Specifically I see:
p <- object$rank
if (p > 0L) {
p1 <- 1L:p
comp <- object$effects[p1]
asgn <-
2007 Jul 12
1
p-value from survreg
The question was how to get the p-value from the fit below, as an S object
sr<-survreg(s~groups, dist="gaussian")
Coefficients:
(Intercept) groups
-0.02138485 0.03868351
Scale= 0.01789372
Loglik(model)= 31.1 Loglik(intercept only)= 25.4
Chisq= 11.39 on 1 degrees of freedom, p= 0.00074
n= 16
----
In general, good places to start are
> names(sr)
>
2010 Aug 30
2
while loop until end of file
Hi Guys,
stumped by a simple problem. I would like to take a file of the form
Pair group param1
1 D 10
1 D 10
1 R 10
1 D 10
2 D 10
2 D 10
2 D 10
2 R 10
2 R 10
etc..
and for each pair, calculate the average of
2010 Aug 25
2
find most repeated item from column in dataframe
R users,
I am trying to find some way to find the value of a column that is repeated
the most for each StandID of a dataframe. I have research methods online
and the help page, but have had no success in finding a solution. I have
tried using the table function but it returns items for the whole dataset
and not by the StandID. Any help will be appreciated. Thanks in advance.
R version 2.11.1
2012 Aug 06
1
cannot find function "simpleRDA2"
Hi,
I am trying to run the command "forward.sel.par," however I receive
the error message: "Error: could not find function 'simpleRDA2'." I
have the vegan library loaded. The documentation on "varpart" has not
helped me to understand why I cannot call this function. Maybe I am
missing something obvious because I am still an 'R' novice.
Below is a
2007 May 23
0
Replicated LR goodness-of-fit tests, heterogeneity G, with loglm?
I have numerous replicated goodness-of-fit experiments (observed compared to expected counts in categories) and these
replicates are nested within a factor.
The expected counts in each cell are external (from a
scientific model being tested). The
calculations I need within each level of the nesting factor are a heterogeneity
G test, with the total G and the pooled G across replicates. Then I
2004 Jan 07
2
problem assigning an array to a variable in a data frame
Dear r-devel list members,
Dirk Eddelbuettel brought the following problem to my attention. The code
is abstracted from the appendix on mixed models from my R and S-PLUS Companion:
> set.seed(12345) # for reproducibility
> library(nlme)
Loading required package: lattice
> data(MathAchieve)
> data(MathAchSchool)
> attach(MathAchieve)
> mses <- tapply(SES, School,
2003 Jul 21
1
how to calculate Rsquare
Hi,
I have something like this:
> x <- 1:10
> y2 <- 30+5*x+rnorm(x,sd=3)
> y <- c(y1,y2)
> x <- c(x,x)
> plot(x,y)
> x <- 1:10
> y1 <- 1+5*x+rnorm(x,sd=2)
> y2 <- 30+5*x+rnorm(x,sd=5)
> y <- c(y1,y2)
> x <- c(x,x)
> f <- factor(rep(c("a","b"),c(10,10)))
> m <- lm(y~x+f)
> anova(m)
Analysis of Variance
2006 Dec 05
1
Spearman correlation ties and discrepancies
Hi. I am currently trying to run some Spearman correlations, and have
encountered two issues.
1) When using cor.test() with a variable that includes ties, I get the
"Cannot compute exact p-values with ties" error. I have read that this
function now uses an asymptotic formula that allows for ties, so do not
understand why I am getting this error. (I am running version 2.4.0.)
I
2010 Sep 15
1
Format Data Issue??
R Users,
I am new to R and have tried to figure out how to automate this
process instead of using excel. I have read in this dataframe into r
with read.table. I need to reshape the data from the first table into
the format of the second table.
TractID StandID Species CruiseDate DBHClass TreesPerAcre
Carbon Stand 1 Loblolly Pine 5/20/2010 10 1.2
Carbon Stand 1 Loblolly Pine
2011 Jul 13
1
max possible rsquare
Dear all,
I have a question regarding the output of the coxph function. What does the
'max possible' exactly mean in the output below? Many thanks.
coef exp(coef) se(coef) robust se z Pr(>|z|)
smocc_zyban -0.4384 0.6451 0.8667 0.9473 -0.463 0.644
self 1.1857 3.2728 0.1405 0.1443 8.216 2.22e-16 ***
smocc_zyban:self
2010 Nov 30
2
Adding noise
Hello,
I have some discrete pvalues and I would like to sort them. Then add random
noise so that they are ordered the same way as the original pvalues. Off
course I don't want any pvalues less than 0 or greater than 1. Any ideas on
how to do this in R?
--
Thanks,
Jim.
[[alternative HTML version deleted]]
2005 Mar 08
1
coefficient of partial determination...partial r square [ redux]
If I'm not mistaken, partial R-squared is the R^2 of the quantities plotted
in a partial residual plot, so you can base the computation on that. Prof.
Fox's `car' package on CRAN has a function for creating those plots, but you
need to figure out the way to extract the quantities being plotted.
[In any case, the basic tools for doing such computations are all in R, and
it
2012 Jul 18
1
Regression Identity
Hi,
I see a lot of folks verify the regression identity SST = SSE + SSR
numerically, but I cannot seem to find a proof. I wonder if any folks on
this list could guide me to a mathematical proof of this fact.
Thanks.
David.
--
View this message in context: http://r.789695.n4.nabble.com/Regression-Identity-tp4636829.html
Sent from the R help mailing list archive at Nabble.com.
2007 Jun 29
1
Shapiro Test P Value Incorrect? (PR#9768)
Full_Name: Jason Polak
Version: R version 2.5.0 (2007-04-23)
OS: Xubuntu 7.04
Submission from: (NULL) (137.122.144.35)
Dear R group,
I have noticed a strange anomaly with the shapiro.test() function. Unfortunately
I do not know how to calculate the shapiro test P values manually so I don't
know if this is an actual bug.
So, to produce the results, run the following code:
pvalues = 0;
for