search for: corsymm

Displaying 20 results from an estimated 41 matches for "corsymm".

2003 Jul 03
1
beginner gls (nlme) question
...vels each, 5 replicates per treatment. The response variable is continuous, normal. I have a correlation matrix of the form: > mat A B C A 1.00 0.75 0 B 0.75 1.00 0 C 0.00 0.00 1 which is common to all observations. How do I construct the call to gls? I think I need to use correlation=corSymm(), but I do not understand the precise syntax. I have read the relevant parts of Pinheiro and Bates, but they only talk about cases where the corSymm correlation structure is modelled, rather than known. I have also searched the R archives, but no luck. I think it should be of the form gls(respons...
2004 Jul 23
0
problem lme using corSymm()
Hi, I got a computational problem with lme (nlme library R 1.9.1) using corSymm(). Here is the data: [,1] [,2] [,3] [,4] [,5] [,6] [1,] 0.19639793 0.09127954 0.11733288 0.07598273 0.06545106 0.06211532 [2,] 0.22773467 0.10981912 0.16052847 0.38101187 0.18353474 0.24072918 [3,] 0.46743388 0.45733836 0.32191178 0.43356107 0.39159746...
2007 May 18
0
gls() error
Hi All How can I fit a repeated measures analysis using gls? I want to start with a unstructured correlation structure, as if the the measures at the occations are not longitudinal (no AR) but plainly multivariate (corSymm). My data (ignore the prox_pup and gender, occ means occasion): > head(dta,12) teacher occ prox_self prox_pup gender 1 1 0 0.76 0.41 1 2 1 1 1.00 1.05 1 3 1 3 0.81 0.91 1 4 2 0 0.96 0.64 0 5...
2006 Jan 18
2
Help with mixed effects models
...----------------------------------------------------------------------- Now then, i used the following R code: bm <- lme (outcome~ -1 + as.factor(endpoint)+ as.factor(endpoint):trt, data=datt, random=~-1 + as.factor(endpoint) + as.factor(endpoint):trt |as.factor(Trial), corr = corSymm(form~-1+as.factor(endpoint)|trial/subject)) I beleive the fixed effects part of the code is okay. My intention for the random effects part is to estimate an intercept and treatment effect for each endpoint at the trial level. The correlation structure should produce a within correlation matrix f...
2000 Mar 28
1
the function lme in package nlme
...tors corresponding to different groups (or clusters in Splus terminology). In Splus I would use the argument (...,cluster = clus,...) I thought that the equivalent thing to do in R is to use a argument of the form (...,correlation = groups,...) where groups is a CorStruct object of the class corSymm, where groups is obtained by groups <- corSymm(form = ~ 1 | clus) groups <- initialize(groups, data = labor.df) Unfortunately this appears to be wrong, since I get the error ********************************************************************** Error in lme.formula(fixed = earning ~ edu +...
2007 Jun 01
2
how to specify starting values in varIdent() of lme()
I was reading the help but just did not get how to specify starting values for varIdent() of the lme() function, although I managed to do it for corSymm(). Do I specify the values just as they are printed out in an output, like c(1, 1.3473, 1.0195). Or do I need to take the residual and multiply it with these like c(0.2235, 0.2235*1.3473, 0.2235*1.0195) or any other form that I dont know of? Thanks Toby Linear mixed-effects model fit by RE...
2004 Jan 22
0
problem fitting linear mixed models
...is different accross tissues. Between-subject variability is modeled with a random intercept, and the within-subject by allowing heteroscedastic and correlated errors accross tissues. The proposed model can then be fitted by lme(Intensity~Tissue-1, weights=varIdent(form=~1|Tissue),correlation=corSymm(),random=~1|Subject) I have fitted this model for each gene. As a consequence of balanced data, fixed-effects estimates are exactly the sample mean for each gene. But I have found one particular gene for which this does not happen: the fixed-effects estimates are completely no-sense. Finally, I...
2011 Jan 27
4
HLM Model
Hi I am trying to convert SAS codes to R, but some of the result are quite different from SAS. When I ran proc mixed, I have an option ddfm=bw followed by the model. How can I show this method in R?(I am thinking that this maybe the reason that I can't get the similar results) below is my SAS codes: proc mixed data=test covtest empirical; class pair grade team school; model score = trt
2003 Jun 19
2
Fitting particular repeated measures model with lme()
...a relatively basic repeated measures model where there are random teacher intercepts, and an unstructured residual covariance matrix within students. The following call to lme() seems to fit the model: lme.t5<-lme(fixed=Y~time,data=d,random=~1|tchid,weights=varIdent(form=~1|time),\ correlation=corSymm(form = ~1|tchid/studid)) Now, I would like to try to alter this model to one in which the "teacher effect" applies to only one year. One can think of the first score on the student as a score from a prior year (for which I have no teacher links), and the second score is from the current...
2006 Mar 07
1
lme and gls : accessing values from correlation structure and variance functions
...the random effects, correlation structure and variance function) from an object of class gls and lme. I used the following models: yah <- gls (outcome~ -1 + as.factor(Trial):as.factor(endpoint)+ as.factor(Trial):as.factor(endpoint):trt, data=datt[datt$Trial<4,], correlation = corSymm(form=~1|as.factor(Trial)/as.factor(subject)), weights=varIdent(form=~1|endpoint)) bm <- lme (outcome~ -1 + as.factor(endpoint)+ as.factor(endpoint):trt, data=datt[datt$Trial<4,], random=~-1 + as.factor(endpoint) + as.factor(endpoint):trt|as.factor(Trial), correlation = corSymm(f...
2006 Nov 20
1
My own correlation structure with nlme
...own corStruct which is different from the classical one available in nlme. The structure of this correlation is given below. I am wondering to know how to continue with this structure by using specific functions (corMatrix, getCovariate, Initialize,...) in order to get a structure like corAR1, corSymm which will be working for my data. Thanks in advance. Regards M. Feddag *Correlation structure _ _* pairCorr <- function(A, B, lowerTriangle = TRUE){ n <- length(A) m <- length(B) if (n != m) stop("A and B must have same length") result <- matrix(0, n, n) s...
2005 Dec 02
1
covariance structures in lmer
Hi, I usually use lme from the nlme library. Now I have read an article about lmer in Rnews and lmer seemed to me more comfortable to use. Unfortunately, I didn't find out how to use covariance structures (e. g. corSymm(), corAR1()). Is there a way to use them similarly as in lme ? Is it implemented ? If somebody knows, please let me know. Thank you very much in advance, Stephan ----------------------------- Dr. Stephan Moratti (PhD) Dept. of Psychology University of Konstanz P.O Box D25 Phone: +40 (0)7531 88...
2006 Apr 20
1
A question about nlme
....formula(paste("~",paste(colnames(ldata[,19:23]),collapse="+"),"-1")) > Block=pdBlocked(list(pdIdent(fmla0),pdIdent(fmla1),pdIdent(fmla2))) > lme(fixed=Score ~ factor(time)-1,data=ldata,random=list(Block), + weights=varIdent(form= ~ 1|time), + correlation=corSymm(form= ~ 1|Block/ID)) and the Error message is Error in parse(file, n, text, prompt) : syntax error in "~ " I repeatedly check the "~", however, I cannot find anything wrong with it. Is there anybody can tell what is wrong? Thank you so much! Zhongmiao Wang
2005 Oct 13
0
nlme gls() error
Hello I'm fitting a gls model with a variance-covariance structure and an getting an error message I don't understand I'm using gls() from the nlme library with the structure defined by correlation = corSymm(form = ~1|Subject), weights = varIdent(form=~1|strata) I get the error Error in recalc.corSymm(object[[i]], conLin) : NA/NaN/Inf in foreign function call (arg 1) My dependent variable is highly positively skewed and has with many zero value. Any ideas as to the cause of the error? Could I...
2006 Jun 01
2
Help: lme
...1 48.58257 600 10 1 1 56.78674 I used the following code to fit my model of interest: ggg <- lme (ST~ -1 + as.factor(endp):Z.sas + as.factor(endp), data=dat4a, random=~-1 + as.factor(endp) + as.factor(endp):Z.sas|as.factor(trials), correlation = corSymm(form=~1|as.factor(trials)/as.factor(id)), weights=varIdent(form=~1|endp)) hh <- summary(ggg) hh Below is the following part of the output of interest I wish to access: Correlation Structure: General Formula: ~1 | as.factor(trials)/as.factor(id) Parameter estimate(s): Corr...
2005 Dec 30
2
unexpected "false convergence"
...,5,0,5,1,11,1,2,4,5,2,4,1,6,1,2,8,16,5,16,3,15,3,12,4,9,2,4,1,8,2,6,4,11,2,9,3,17,2,6) id<-rep(1:13,rep(4,13)) test<-gl(2,1,52,labels=c("pre","post")) coder<-gl(2,2,52,labels=c("two","three")) il<-data.frame(id,score,test,coder) attach(il) cs1<-corSymm(value=c(.396,.786,.718,.639,.665,.849),form=~1|id) cs1<-Initialize(cs1,data=il) run<-glmmPQL(score~test+coder, random=~1|id,family=poisson,data=il,correlation=cs1) The output under R 2.2.1, which leaves the run object (last line of the code) undefined: iteration 1 iteration 2 iteration 3...
2006 Jun 06
1
spatial corStruct in lme
...o important here, but four pertinent variables are distance-dependent competition indices: C_spp1fromspp1, C_12, C_21, C_22. The random structure is: random = ~ 1 | PLOT/TREE. More complex random structures aren't required, there's no obvious heterogeneity, and the serial correlations (corSymm) are trivial. I've been trying to fit a spatial correlation structure using the X, Y coordinates of each tree. I've obviously missed a point or so here. It seems to me that such a structure could be fit for all trees (both species) on their average growth over the 3 intervals, by interv...
2006 May 30
1
Query: lme output
...Users I have a problem accessing some values in the output from the summary of an lme fit. I fit the model below: ggg <- lme (ST~ -1 + as.factor(endp):Z.sas + as.factor(endp), data=dat4a, random=~-1 + as.factor(endp) + as.factor(endp):Z.sas|as.factor(trials), correlation = corSymm(form=~1|as.factor(trials)/as.factor(id)), weights=varIdent(form=~1|endp)) hh <- summary(ggg) hh Below is the following part of the output of interest: Correlation Structure: General Formula: ~1 | as.factor(trials)/as.factor(id) Parameter estimate(s): Correlation: 1...
2012 Jul 06
2
Mixed Models providing a correlation structure.
Hi folks, I was wondering how to run a mixed models approach to analyze a linear regression with a user-defined covariance structure. I have my model y = xa +zb +e and b ~ N (0, C*sigma_square). (and a is a fixed effects) I would like to provide R the C (variance-covariance) matrix I can easily provide an example, but at this point I am first trying to know what is the best package the
2003 Jul 22
2
animal models and lme
Hi, You should look at Pinheiro and Bates (2000) Mixed-effects models in S and S-Plus. It describes how to format the correlation matrix to pass to functions lme and gls. Basically, the correlation matrix has to be one of the corStruct classes, probably corSymm for your example. So in the call to lme (or gls if you really have no random effects), use something like: correlation=corSymm(AGRM[lower.tri(AGRM)], fixed=TRUE). Anyway, it's all there in the book. HTH, Simon. Simon Blomberg, PhD Depression & Anxiety Consumer Research Unit Centre for Me...