Displaying 20 results from an estimated 7000 matches similar to: "Not reproducing GLS estimates"
2004 Dec 29
3
gls model and matrix operations
Dear List:
I am estimating a gls model and am having to make some rather unconventional modifications to handle a particular problem I have identified. My aim is to fit a GLS with an AR1 structure, obtain the variance-covariance matrix (V), modify it as needed given my research problem, and then reestimate the GLS by brute force using matrix operations. All seems to be working almost perfectly,
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
2007 Jan 06
1
help with gls
Hello R-users,
I am using gls function in R to fit a model with certain correlation
structure.
The medol as:
fit.a<-gls(y~1,data=test.data,correlation=corAR1(form=~1|aa),method="ML")
mu<-summary(fit.a)$coefficient
With the toy data I made to test, the estimate of mu is exactly equal to
the overall mean of y which can not be true.
But, if I make a toy data with y more than two
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
2005 Nov 17
1
anova.gls from nlme on multiple arguments within a function fails
Dear All --
I am trying to use within a little table producing code an anova
comparison of two gls fitted objects, contained in a list of such
object, obtained using nlme function gls.
The anova procedure fails to locate the second of the objects.
The following code, borrowed from the help page of anova.gls,
exemplifies:
--------------- start example code ---------------
library(nlme)
##
2007 Dec 05
0
lme output
Dear all,
I noticed the following in the call of lme using msVerbose.
fm1 <- lme(distance ~ age, data = Orthodont, control = lmeControl(msVerbose=T))
9 318.073: -0.567886 0.152479 1.98021
10 318.073: -0.567191 0.152472 1.98009
11 318.073: -0.567208 0.152473 1.98010
fm2 <- lme(distance ~ age, random =~age, data = Orthodont,
2005 Apr 11
0
correlation range estimates with nlme::gls
I'm trying to do a simple (?) analysis of a 1D spatial data set,
allowing for spatial autocorrelation. (Actually, I'm comparing expected
vs. observed for a spatial model of a 1D spatial data set.) I'm using
models like
gls(obs~exp,correlation=corExp(form=~pos),data=data)
or
gls(obs~exp,correlation=corLin(form=~pos),data=data)
This form is supposed to fit a linear model of
2003 Dec 02
0
names of parameters from nonlinear model?
I've been trying to figure out how to build a list of terms from a nonlinear
model (terms() returns a error). I need to compute and evaluate the partial
derivatives (Jacobian) for each equaiton in a set of equations.
For example:
> eqn <- q ~ s0 + s1 * p + s2 * f + s3 * a
> sv2 <- c(d0=3,d1=4.234,d2=4,s0=-2.123,s1=0.234,s2=2.123,s3=4.234)
> names( sv2 )
[1] "d0"
2000 Mar 07
1
Problems with nlme (PR#471)
Dear R developers,
first of all let me join the chorus of congratulations for the release
of R 1.0.0. Well, done!
Unfortunately, I find it necessary to e-mail in a bug report regarding
the `nlme' package. On my office machine I experience the following
trouble:
bossiaea:/opt/R$ R CMD check -c nlme
Checking package `nlme' ...
Massaging examples into `nlme-Ex.R' ...
Running
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 Aug 01
1
gls function
Dear all
I use the gls function but in contrast to the lm function in which when I type summary(lm(...))$coef I receive all the coefficients (estimate, Std. Error, t-value and pvalue), with gls when I type summary(gls(...))$coef I only receive the estimate of the reg. coefficient without std. error and t- and p-values.
Dou you have any suggestion how to solve my problem?
With kind regards
2011 Jun 22
0
GLS models and variance explained
Dear list,
Inspecting residuals of my linear models, I detected spatial autocorrelation.
In order to take this into account, I decided to use the GLS method
with the correlation = corGaus ( ~ X + Y).
Then, I can sort my GLS models based on their AIC.
But ... how to know the proportion of the variance explained by the
best one (it can be best of the worst models) ?
R-squared value has not the
2006 Aug 09
1
Joint confidence intervals for GLS models?
Dear All,
I would like to be able to estimate confidence intervals for a linear
combination of coefficients for a GLS model. I am familiar with John
Foxton's helpful paper on Time Series Regression and Generalised Least
Squares (GLS) and have learnt a bit about the gls function.
I have downloaded the gmodels package so I can use the estimable
function. The estimable function is very
2011 Aug 06
0
ridge regression - covariance matrices of ridge coefficients
For an application of ridge regression, I need to get the covariance
matrices of the estimated regression
coefficients in addition to the coefficients for all values of the ridge
contstant, lambda.
I've studied the code in MASS:::lm.ridge, but don't see how to do this
because the code is vectorized using
one svd calculation. The relevant lines from lm.ridge, using X, Y are:
2006 Nov 06
1
question about function "gls" in library "nlme"
Hi:
The gls function I used in my code is the following
fm<-gls(y~x,correlation=corARMA(p=2) )
My question is how to extact the AR(2) parameters from "fm".
The object "fm" is the following. How can I extract the correlation parameters
Phi1 and Phi2 from "fm"? These two parametrs is not in the "coef" componenet of "fm".
Thanks a
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 --
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)+
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
2002 Feb 13
1
nlme package dependencies?
Dear R-help,
The following nlme example, from help(Variogram.gls), does not work on my
system.
> data(BodyWeight)
> fm1 <- gls(weight ~ Time * Diet, BodyWeight)
> Variogram(fm1, form = ~ Time | Rat)[1:10,]
Error in FUN(X[[1]], ...) : unused argument(s) (method ...)
It looks like I might not have loaded a necessary package. I did load nls
and lattice (the latter not actually being
2005 Jul 15
1
Adjusted p-values with TukeyHSD (patch)
Dear R-developeRs,
Attached follows a patch against svn 34959 that adds the
printing of p-values to the TukeyHSD.aov function in stats package. I
also updated the corresponding documentation file and added a 'see also'
reference to the simint function of the multcomp package.
As it was already brought up in a previous thread [1] in R-help,
one can obtain the adjusted