Displaying 20 results from an estimated 4000 matches similar to: "Analyses of covariation with lme() or lm()"
2005 Oct 07
1
The mathematics inside lme()
Hello all!
Consider a dataset with a grouping structure, Group (factor)
Several treatments, Treat (factor)
Some sort of yield, Yield (numeric)
Something, possibly important, measured for each group; GroupCov (numeric)
To look for fixed effects from Treat on Yield, a first attempt could be:
m1 <- lm(Yield ~ Treat)
which gives, in a symmetric situation, the same estimated fixed effects as:
2017 Jun 06
4
integrating 2 lists and a data frame in R
Dear Bert,
thank you for your response. here it is the piece of R code : given 3 data
frames below ---
N <- data.frame(N=c("n1","n2","n3","n4"))
M <- data.frame(M=c("m1","m2","m3","m4","m5"))
C <- data.frame(n=c("n1","n2","n3"),
2017 Jun 06
0
integrating 2 lists and a data frame in R
Hi Bogdan,
Kinda messy, but:
N <- data.frame(N=c("n1","n2","n3","n4"))
M <- data.frame(M=c("m1","m2","m3","m4","m5"))
C <- data.frame(n=c("n1","n2","n3"), m=c("m1","m1","m3"), I=c(100,300,400))
2017 Jun 06
2
integrating 2 lists and a data frame in R
> On Jun 6, 2017, at 4:01 AM, Jim Lemon <drjimlemon at gmail.com> wrote:
>
> Hi Bogdan,
> Kinda messy, but:
>
> N <- data.frame(N=c("n1","n2","n3","n4"))
> M <- data.frame(M=c("m1","m2","m3","m4","m5"))
> C <-
2017 Jun 06
0
integrating 2 lists and a data frame in R
Thank you David. Using xtabs operation simplifies the code very much, many
thanks ;)
On Tue, Jun 6, 2017 at 7:44 AM, David Winsemius <dwinsemius at comcast.net>
wrote:
>
> > On Jun 6, 2017, at 4:01 AM, Jim Lemon <drjimlemon at gmail.com> wrote:
> >
> > Hi Bogdan,
> > Kinda messy, but:
> >
> > N <-
2003 Apr 28
2
stepAIC/lme problem (1.7.0 only)
I can use stepAIC on an lme object in 1.6.2, but
I get the following error if I try to do the same
in 1.7.0:
Error in lme(fixed = resp ~ cov1 + cov2, data = a, random = structure(list( :
unused argument(s) (formula ...)
Does anybody know why?
Here's an example:
library(nlme)
library(MASS)
a <- data.frame( resp=rnorm(250), cov1=rnorm(250),
cov2=rnorm(250),
2008 Aug 18
1
lmer syntax, matrix of (grouped) covariates?
I have a fairly large model:
> length(Y)
[1] 3051
> dim(covariates)
[1] 3051 211
All of these 211 covariates need to be nested hierarchically within a
grouping "class", of which there are 8. I have an accessory vector, "
cov2class" that specifies the mapping between covariates and the 8 classes.
Now, I understand I can break all this information up into individual
2017 Jun 06
1
integrating 2 lists and a data frame in R
Simple matrix indexing suffices without any fancier functionality.
## First convert M and N to character vectors -- which they should
have been in the first place!
M <- sort(as.character(M[,1]))
N <- sort(as.character(N[,1]))
## This could be a one-liner, but I'll split it up for clarity.
res <-matrix(NA, length(M),length(N),dimnames = list(M,N))
res[as.matrix(C[,2:1])] <-
2009 Apr 22
4
read.table or read.csv without row index?
Hello all,
Probably my concepts about the data.frame and matrix and array in R
are not clear, I need some clarification to help me understand them
better.
>M <- read.table("test1.csv",sep=",",row.names=NULL,header=T)
gives me: M as
M1 M2 M3 M4 M5 M6 M7 M8 M9 M10
1 9 11 14 15 18 20 20 20 20 20
2 3 4 8 9 11 12 14 15 15 15
3 4 5 8 8 9 9 9 9 9 9
4 4
2013 Sep 05
2
binary symmetric matrix combination
Hi,
May be this helps:
m1<- as.matrix(read.table(text="
y1 g24
y1 0 1
g24 1 0
",sep="",header=TRUE))
m2<-as.matrix(read.table(text="y1 c1 c2 l17
?y1 0 1 1 1
?c1 1 0 1 1
?c2 1 1 0 1
?l17 1 1 1 0",sep="",header=TRUE))
m3<- as.matrix(read.table(text="y1 h4??? s2???? s30
?y1 0 1 1 1
?h4 1 0 1 1
?s2 1 1 0 1
?s30 1 1 1
2017 Jun 06
1
integrating 2 lists and a data frame in R
Here's another approach:
N <- data.frame(N=c("n1","n2","n3","n4"))
M <- data.frame(M=c("m1","m2","m3","m4","m5"))
C <- data.frame(n=c("n1","n2","n3"), m=c("m1","m1","m3"), I=c(100,300,400))
# Rebuild the factors using M and N
C$m <-
2012 Oct 14
1
Problems with coxph and survfit in a stratified model, with interactions
First, here is your message as it appears on R-help.
On 10/14/2012 05:00 AM, r-help-request@r-project.org wrote:
> I?m trying to set up proportional hazard model that is stratified with
> respect to covariate 1 and has an interaction between covariate 1 and
> another variable, covariate 2. Both variables are categorical. In the
> following, I try to illustrate the two problems that
2017 Jun 06
2
integrating 2 lists and a data frame in R
Dear all,
please could you advise on the R code I could use in order to do the
following operation :
a. -- I have 2 lists of "genome coordinates" : a list is composed by
numbers that represent genome coordinates;
let's say list N :
n1
n2
n3
n4
and a list M:
m1
m2
m3
m4
m5
2 -- and a data frame C, where for some pairs of coordinates (n,m) from the
lists above, we have a
2003 Jun 04
3
Slow ttests in R-devel
Hello ...
I've noticed that some of our Bioconductor code was running drastically
slower under current R-devel vs. current R-patched - one example is below
using a ttest. I have the following snippet of code that demonstrates the
problem while avoiding "real" code that takes an extremely long time to
finish on R-devel:
library(genefilter)
data(eset)
eset$cov1
z <-
2007 Sep 26
2
generate fourth vector based on known correlations
I am trying to generate a fourth vector,z, given three known and fixed
vectors, x1,x2,x3 with corresponding known and fixed correlations with
themeselves and with z. That is, all correlations are known and
prespecified. How can I do this?
Thank you,
ben
2006 Nov 28
3
Predicted values in lmer modeling
Dear All,
I am working with linear mixed-effects models using the lme4 package in
R. I created a model with the lmer function including some main effects,
a two-way interaction and a random effect. Now I am searching for a way
to save the predicted values for this model.
As far as I can see, there is no command in lme4 to save the predicted
values (like the predict(model) function in e.g.
2011 Jun 07
1
rgl: insert pauses in animation sequence / movie formats other than gif?
Two questions related to creating animated movies with rgl:
1. I've created an rgl scene with 5 different views I want to display in
a movie, but I'd like to insert pauses (say, 5 seconds)
at each view. How can I do this?
I first created 5 userMatrix's, then
play3d( par3dinterp( userMatrix=list(M1, M2, M3, M4, M5)),
,duration=2*60/5) )
then tried simply repeating each twice,
2017 Jun 06
0
integrating 2 lists and a data frame in R
Reproducible example, please. -- In particular, what exactly does C look ilike?
(You should know this by now).
-- Bert
Bert Gunter
"The trouble with having an open mind is that people keep coming along
and sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )
On Mon, Jun 5, 2017 at 6:45 PM, Bogdan Tanasa <tanasa at gmail.com>
2012 Jul 06
2
Anova Type II and Contrasts
the study design of the data I have to analyse is simple. There is 1 control group (CTRL) and 2 different treatment groups (TREAT_1 and TREAT_2).
The data also includes 2 covariates COV1 and COV2. I have been asked to check if there is a linear or quadratic treatment effect in the data.
I created a dummy data set to explain my situation:
df1 <- data.frame(
Observation =
2008 Aug 04
1
simulate data based on partial correlation matrix
Given four known and fixed vectors, x1,x2,x3,x4, I am trying to
generate a fifth vector,z, with specified known and fixed partial
correlations.
How can I do this?
In the past I have used the following (thanks to Greg Snow) to
generate a fifth vector based on zero order correlations---however I'd
like to modify it so that it can generate a fifth vector with specific
partial