Displaying 20 results from an estimated 10000 matches similar to: "question of correlation structure in gls"
2003 Mar 01
1
error message from gls(), unstructured in lower triangle, identical diagonal, help.
Hi, nlme users,
I am fitting a model for repeated measures, using
gls(). The var-cov structure is UNSTRUCTURED in lower
triangle and identical for the diagonal, for which I
still have no idea how to fit using PROC MIXED.
The error message is as follows:
Error in "coef<-.corNatural"(*tmp*, value =
log((cStNatPar + 1)/(1 - cStNatPar))) :
NA/NaN/Inf in foreign function call
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
2004 Oct 08
1
nlme vs gls
Dear List:
My question is more statistical than R oriented (although it originates
from my work with nlme). I know statistical questions are occasionally
posted, so I hope my question is relevant to the list as I cannot turn
up a solution anywhere else. I will frame it in the context of an R
related issue.
To illustrate the problem, consider student achievement test score data
with multiple
2006 Mar 07
1
lme and gls : accessing values from correlation structure and variance functions
Dear R-users
I am relatively new to R, i hope my many novice questions are welcome.
I have problems accessing some objects (specifically 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)+
2003 Jul 03
1
beginner gls (nlme) question
Hi all,
I am trying to get a handle on gls (package nlme). I have a toy problem: 3 fixed factors (A, B, C), two levels 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
2008 Oct 13
0
correlation structure in gls or lme/lmer with several observations per day
Hi,
To simplify, suppose I have 2 observations each day for three days. I
would like to define the correlation structure of these 6 observations
as follows: the correlation of 2 observations on the same day is, say,
alpha, the correlation for 2 observations one day apart is rho and the
correlation for 2 observations 2 days apart is rho^2. I.e. I would like
to have an AR1 correlation + a
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
2009 Mar 04
0
'anova.gls' in 'nlme' (PR#13567)
There is a bug in 'anova.gls' in the 'nlme' package (3.1-90). The=20
bug is triggered by calling the function with a single 'gls' object=20
and specifying the 'Terms' argument but not the 'L' argument:
> library(nlme)
> fm1Orth.gls <- gls(distance ~ Sex * I(age - 11), Orthodont,
+ correlation =3D corSymm(form =3D ~ 1 |
2005 May 17
0
problem with gls : combining weights and correlation structure
Dear R-users,
I hope you will have time to read me and I will try to be brief. I am also
sorry for my poor english.
I used gls function from the package nlme to correct two types of bias in my
database. At first, because my replicates are spatially aggregated, I would
like to fit a corStruct function like corLin, corSpher, corRatio, corExp or
corGaus in my gls model, and simultaneously,
2009 Jan 28
1
gls prediction using the correlation structure in nlme
How does one coerce predict.gls to incorporate the fitted correlation
structure from the gls object into predictions? In the example below
the AR(1) process with phi=0.545 is not used with predict.gls. Is
there another function that does this? I'm going to want to fit a few
dozen models varying in order from AR(1) to AR(3) and would like to
look at the fits with the correlation structure
2010 Dec 26
0
GLS with corAR(1) correlation structure residual/standard error calculation
I am using the gls function to fit a two-stage least squares model with
first order autoregressive error terms. Since there is no automated
adjustment for the use of two-stage least squares in this package, I am
trying to manually replicate standard errors of the coefficient estimates in
order to adjust for a first stage OLS estimate of endogenous variables.
However, thus far I have been unable to
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
2006 Jul 01
1
nlme: correlation structure in gls and zero distance
Dear listers,
I am trying to model the distribution of fox density over years in the
Doubs department. Measurements have been taken on 470 plots in March
each year and georeferenced. Average density is supposed to be different
each year.
In a first approach, I would like to use a general model of this type,
taking spatial correlation into account:
2005 Dec 09
1
R-help: gls with correlation=corARMA
Dear Madams/Sirs,
Hello. I am using the gls function to specify an arma correlation during
estimation in my model. The parameter values which I am sending the
corARMA function are from a previous fit using arima. I have had some
success with the method, however in other cases I get the following error
from gls: "All parameters must be less than 1 in absolute value". None
of
2003 Nov 21
0
gls with serial correlation
Hello there fellow R users,
Im trying to fit a gls model to data which has serial correlation in the
errors e(t)=p*e(t-1).
However I dont seem to be having much luck in erradicating the
autocorrelation in the residuals.
I have created the following example.
library(nlme)
x<-rnorm(100)
y<-3+2*x
y<-y+arima.sim(100,model=list(ar=(0.6)))+rnorm(100,0,0.2)
#Create a data set with first
2007 Jun 25
3
Bug in getVarCov.gls method (PR#9752)
Hello,
I am using R2.5 under Windows.
Looks like the following statement
vars <- (obj$sigma^2)*vw
in getVarCov.gls method (nlme package) needs to be replaced with:
vars <- (obj$sigma*vw)^2
With best regards
Andrzej Galecki
Douglas Bates wrote:
>I'm not sure when the getVarCov.gls method was written or by whom. To
>tell the truth I'm not really sure what
2004 Sep 03
0
ML vs. REML with gls()
Hello listmembers,
I've been thinking of using gls in the nlme package to test for serial
correlation in my data set. I've simulated a sample data set and have
found a large discrepancy in the results I get when using the default
method REML vs. ML.
The data set involves a response that is measured twice a day (once for
each level of a treatment factor). In my simulated data set, I
2011 Nov 22
0
Error in gls function in loop structure
Hi, r-users
I got a problem when I try to call a *gls* function in loop structure.
The gls function seems not able to recognize the parameters that I pass
into the loop function!
(But, if I use lm function, it works.)
The code looks like this:
=================================================
gls.lm <- function(Data, iv1, dv1)
{
gls.model <- gls(Data[ , dv1] ~ Data[ , iv1], correlation =
2011 Mar 23
2
Estimating correlation in multiple measures data
Dear R-helpers,
This may sound simple to you, but I'm a beginner in this, so please be
forgiving.
I have a following problem: two analytes were measured in patient's
blood on 4 occasions: ProteinA and ProteinB. How to correctly evaluate
correlation between ProteinA and ProteinB?
I tried:
x <- data.frame(Patient.ID=rep(1:10, each=4), Visit=rep(c(1:4),10),
ProteinA=rnorm(m=10,
2006 Nov 20
1
My own correlation structure with nlme
Dear all,
I am trying to define my 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.