Displaying 20 results from an estimated 2000 matches similar to: "nlme gls() error"
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)+
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 |
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
2005 Sep 27
3
quick "points" question
Hi
Just one of those niggles.......
I've just been trying to plot a filled circle.
I thought that this would do it
plot(1,1,type="n")
points(1,1,pch=1,bg="blue",cex=5)
#bg: background ("fill") color for open plot symbols
But I need to do this instead
points(1.2,1,pch=19,col="blue",cex=5)
Am I misunderstanding the "bg" option in the points
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
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
2004 Jan 22
0
problem fitting linear mixed models
Hello,
I'm fitting linear mixed models to gene-expression data from
microarrays, in a data set where 4608 genes are studied.
For a sample of 5 subjects and for each gene we observe the expression
level (Intensity) in four different tissues: N, Tp, Tx and M.
I want to test whether the expression level is different accross
tissues. Between-subject variability is modeled with a random
2002 Jul 01
1
Defining own variance function / quasi-likelihood in a GLM
Hello,
I've been looking in the on-line manuals and searching past posts but
can't find an answer to this question.
I'd like to define my own variance function in a GLM.
The function glm(formula, family=quasi(var="var function"))
lets me choose from a selection of built in variances, but I want to
define my own function for the variance.
Is there an S-plus
2003 Apr 02
8
lm with an arbitrary number of terms
Hello folks,
Any ideas how to do this?
data.frame is a data frame with column names "x1",...,"xn"
y is a response variable of length dim(data.frame)[1]
I want to write a function
function(y, data.frame){
lm(y~x1+...+xn)
}
This would be easy if n was always the same.
If n is arbitrary how could I feed the x1+...+xn terms into lm(response~terms)?
Thanks
Richard
--
Dr.
2001 Nov 28
2
Why are looping variables not local?
Hello,
I've had a quick look on the list and can't find an answer to this niggle.
Whilst debugging some code, I noticed that looping variables in R are not
local to the loop as seams common in procedural languages.
For example consider the following piece of code:
for(i in 1:3){
cat(i,"")
for(i in c("a","b","c")){
cat(i,"")
2011 May 21
1
predict.gls choking on levels of factor
I've got a gls formula that's a mix of continuous and ordered variables.
I wanted to use gls because I wanted to use the varIdent structure.
Anyway, attempts to use "predict.gls" choke with the error that the
levels I use are not allowed for one of them -- the first one
alphabetically, so I'd guess the second would have the same problem.
So I have three linked questions --
2003 Mar 14
0
gls with "crossed heteroscedasticity"
Dear All,
I am using the function gls (in the nlme package) and I would like to fit a
heteroscedastic model, with different variances for each of the levels of two
stratification variables.
In p. 210 of Pinheiro & Bates ("Mixed effects models in S and S-Plus", 2000,
Springer), the authors show the use of the "*" operator. However, that is not
what I want, because it
2010 Jun 24
1
Question on WLS (gls vs lm)
Hi all,
I understand that gls() uses generalized least squares, but I thought
that maybe optimum weights from gls might be used as weights in lm (as
shown below), but apparently this is not the case. See:
library(nlme)
f1 <- gls(Petal.Width ~ Species / Petal.Length, data = iris, weights
= varIdent(form = ~ 1 | Species))
aa <- attributes(summary(f1)$modelStruct$varStruct)$weights
f2 <-
2002 Apr 22
3
glm() function not finding the maximum
Hello,
I have found a problem with using the glm function with a gamma
family.
I have a vector of data, assumed to be generated by a gamma distribution.
The parameters of this gamma distribution are estimated in two ways (i)
using the glm() function, (ii) "by hand", using the optim() function.
I find that the -2*likelihood at the maximum found by (i) is substantially
larger than that
2007 May 21
1
can I get same results using lme and gls?
Hi All
I was wondering how to get the same results with gls and lme. In my lme, the
design matrix for the random effects is (should be) a identity matrix and
therefore G should add up with R to produce the R matrix that gls would report
(V=ZGZ'+R). Added complexity is that I have 3 levels, so I have R, G and say H
(V=WHW'+ZGZ'+R). The lme is giving me the correct results, I am
2009 Mar 02
0
question of correlation structure in gls
Dear R users,
I want to fit a model with within-subject correlations but with no random
effects. So I could use gls to set correlation=corSymm(~1 | group). Here
the problem I encountered is that I have 90 groups, and for the first,
second and third 30 groups I want them to have three different
unstructured correlation structures. Can I achieve that in gls() of the
nlme package?
Thank you!
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?
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
2009 Feb 02
0
repeated measures with gls
I am using the gls function of the nlme package to analyze data sets of
soil respiration which have the following design: 3 complete blocks x 5
sampling dates (time from fertilization) x 3 fertilization levels. The
fertilization dates are equal for all subjects (blocks) but not
periodical (-46, 10, 24, 53, 123 days from the event).
The code that I've been using is:
fit.csnC<- gls(dno.C
2006 Apr 20
1
A question about nlme
Hello,
I have used nlme to fit a model, the R syntax is like
fmla0<-as.formula(paste("~",paste(colnames(ldata[,9:13]),collapse="+"),"-1"))
> fmla1<-as.formula(paste("~",paste(colnames(ldata[,14:18]),collapse="+"),"-1"))
>