Displaying 20 results from an estimated 1100 matches similar to: "extraction of mean square value from ANOVA"
2011 Oct 31
3
How to use IML with R and SAS
Hello,
I have a for loop that generates data in R. With the IML program, I would
like to analyze data in SAS from each iteration of the for loop in R. It
would be helpful if someone could explain to me how to analyze data this
way.
Thanks
[[alternative HTML version deleted]]
2011 Jul 31
2
Legend for 2 plots on same screen
Hello,
I have two plots on the same screen. I use the command par(mfrow=c(1,2)) in
order to do this. When I try to make a legend for both plots, it only puts
the legend in the plot on the right side. If I would like a legend that is
outside of both of the plots, how would I do this?
Thanks
[[alternative HTML version deleted]]
2011 Aug 08
1
Var-Cov matrix from LMER function
Hello,
Is there a way to get the Var-Cov matrix from the LMER function?
Thanks
[[alternative HTML version deleted]]
2012 Nov 06
2
Append Data to an Excel File through each Iteration of a For Loop
Hi,
I would like to find a way to append data to an excel file through each
iteration of a for loop. Is there a way to use a command such as
write.table and append each iteration to a different sheet?
Thanks
[[alternative HTML version deleted]]
2004 Mar 08
2
getting the std errors in the lm function
Hello,
I have a simple question for you:
making:
mylm<-lm(y~x)
summary(mylm)
I get the following results:
******************************************************
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 16.54087 0.19952 82.91 <2e-16 ***
x[1:19] -2.32337 0.04251 -54.66 <2e-16 ***
******************************************************
2010 Sep 14
1
NA confusion (length question)
Hi folks,
I am running a very simple regression using
mylm <- lm(mass ~ tarsus, na.action=na.exclude)
I would like the use the residuals from this analysis for more
regression but I'm running into a snag when I try
cbind(mylm$residuals, mydata) # where my data is the original data set
The error tells me that it cannot use cbind because the length of
mylm$residuals is
2003 Oct 11
1
Subclassing lm
I'd trying to subclass the "lm" class to produce a "mylm" class whose
instances behave like lm objects (are accepted by methods like summary.lm)
but have additional data or slots of my own design.
For starters:
setClass("mylm", "lm")
produces the somewhat cryptic:
Warning message:
Old-style (``S3'') class "mylm" supplied as a
2009 Mar 31
1
using "substitute" inside a legend
Hello list,
I have a linear regression:
mylm = lm(y~x-1)
I've been reading old mail postings as well as the plotmath demo and I came
up with a way to print an equation resulting from a linear regression:
model = substitute(list("y"==slope%*%"x", R^2==rsq),
list(slope=round(mylm$coefficients[[1]],2),rsq=round(summary(mylm)$adj.r.squared,
2)))
I have four models and I
2009 May 14
1
automated polynomial regression
Dear all -
We perform some measurements with a machine that needs to be
recalibrated. The best calibration we get with polynomial regression.
The data might look like follows:
> true_y <- c(1:50)*.8
> # the real values
> m_y <- c((1:21)*1.1, 21.1, 22.2, 23.3 ,c(25:50)*.9)/0.3-5.2
> # the measured data
> x <- c(1:50)
> # and the x-axes
>
> # Now I do the following:
2011 Dec 04
1
rnorm command
Hello,
I use the command rnorm, and I feed these results into a lmer command.
Since I am using the rnorm command I expect to get different results for
each iteration, yet for each iteration I am getting the same answer. If
someone understands why I am getting the same answer every time with a
random number generator, I would appreciate help in understanding why this
is happening. Is the lmer
2012 Aug 28
1
write.table and read.table commands
Greetings,
When I try to use the write.table command to save a matrix as a file and
then open the file with read.table, if I try to take the mean of the entire
matrix, instead each column of the matrix has its mean calculated. I have
copied and pasted an example of my code below. When I try to make the
header false with the read.table command, I am given an error message. I
would appreciate any
2009 Jan 24
2
how to prevent duplications of data within a loop
Hi All,
I had posted a question on a similar topic, but I think it was not
focused. I am posting a modification that I think better accomplishes
this.
I hope this is ok, and I apologize if it is not. :)
I am looping through variables and running several regressions. I have
reason to believe that the data is being duplicated because I have
been
monitoring the memory use on unix.
How can I avoid
2007 Apr 06
2
lm() intercept at the end, rather than at the beginning
Hi,
I wonder if someone has already figured out a way of making
summary(mylm) # where mylm is an object of the class lm()
to print the "(Intercept)" at the last line, rather than the first
line of the output. I don't know about, say, biostatistics, but in
economics the intercept is usually the least interesting of the
parameters of a regression model. That's why, say, Stata
2005 Jun 16
1
regressing each column of a matrix on all other columns
DeaR list
I would like to predict the values of each column of a matrix A by
regressing it on all other columns of the same matrix A. I do this with
a for loop:
A <- B <- matrix(round(runif(10*3,1,10),0),10)
A
for (i in 1:length(A[1,])) B[,i] <- as.matrix(predict(lm( A[,i] ~
A[,-i] )))
B
It works fine, but I need it to be faster. I've looked at *apply but
just can't
2007 Oct 30
1
Some matrix and sandwich questions
Dear R-help,
I have a four-part question about regression, matrices, and sandwich package.
1) In the sandwich package, I would like to better understand the
meat() function.
>From the bread() documentation, for a simple OLS regression, bread() returns
(1/n * X'X)^(-1)
That is, for a simple regression (per the documentation on bread()):
MyLM <- lm(y ~ x)
bread(MyLM)
2011 Aug 06
2
Problems to extract data from anova table
Hi,
this is my script
> anova <- aov(data ~ Ts*Te*t + Error(R/Ts*Te*t))
> results <- summary(anova$Within)
this is results
Df Sum Sq Mean Sq F value Pr(>F)
Ts 2 1232.2 616.11 53.606 3.965e-10 ***
Ts:Te 4 4889.5 1222.37 106.356 4.075e-16 ***
Ts:t 4 6472.1 1618.01 140.780 < 2.2e-16 ***
Ts:Te:t 8 4181.0 522.63 45.473 1.088e-13 ***
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,
2013 May 16
2
R looping help
Hey I'm not really sure what I should put on here, but I am having trouble
with my R code. I am trying to get the p-values, R^2s etc for a number of
different groups of variables that are all in one dataset.
This is the code:
#Stand counter
st<-1
#Collections
stands<-numeric(67)
slopes<-numeric(67)
intercepts<-numeric(67)
mses<-numeric(67)
rsquares<-numeric(67)
2002 Jul 01
1
a little statistics help
Dear R-guRus:
I am stuck with the following problem in R:
Let's say i have a data.frame with columns X,Y & Z.
X is a column of numbers, Y is a column of N
factors "A", "B", "C", "D", etc and Z is a column of n
factors "a", "b", "c", etc
if i do MyLm<-lm(X~Y*Z - 1) i get all N coefficients for Y-factors, but
only
2009 Sep 20
3
plotting least-squares regression against x-axis
Hi,
I want to plot the residuals of a least-squares regression.
plot(lm(y~x), which=1)
does this, but it plots the y-axis of my data on the x-axis of the
residuals plot. That is, it plots the residual for each y-value in the
data. Can I instead use the x-axis of my data as the x-axis of the
residuals plot, showing the residual for a given x?
Thanks!
Jason Priem
University of North