Displaying 20 results from an estimated 8000 matches similar to: "linear hypothesis test in gls model"
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
2005 Dec 22
2
Testing a linear hypothesis after maximum likelihood
I'd like to be able to test linear hypotheses after setting up and running a
model using optim or perhaps nlm. One hypothesis I need to test are that
the average of several coefficients is less than zero, so I don't believe I
can use the likelihood ratio test.
I can't seem to find a provision anywhere for testing linear combinations of
coefficients after max. likelihood.
Cheers
2011 Mar 16
1
Autocorrelation in linear models
I have been reading about autocorrelation in linear models over the last
couple of days, and I have to say the more I read, the more confused I
get. Beyond confusion lies enlightenment, so I'm tempted to ask R-Help for
guidance.
Most authors are mainly worried about autocorrelation in the residuals,
but some authors are also worried about autocorrelation within Y and
within X vectors
2008 Jun 07
1
Multivariate LM: calculating F-values after calling linear.hypothesis
Dear R users,
I am analyzing several response variables (all scaled to [0;1]) using a
multivariate linear model.
After fitting the model, I set up a hypothesis matrix to test specific
contrasts for these response variables; for example: "a always increases
significantly more than b when regressed against x".
What I am stuck with now is how to calculate the correct F-values (and
2012 Apr 19
2
Gls function in rms package
Dear R-help,
I don't understand why Gls gives me an error when trying to fit a
model with AR(2) errors, while gls (from nlme) does not. For example:
library(nlme)
library(rms)
set.seed(1)
d <- data.frame(x = rnorm(50), y = rnorm(50))
gls(y ~ x, data=d, correlation = corARMA(p=2)) #This works
Gls(y ~ x, data=d, correlation = corARMA(p=2)) # Gives error
# Error in
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
2003 Sep 25
1
Error from gls call (package nlme)
Hi
I have a huge array with series of data. For each cell in the array I
fit a linear model, either using lm() or gls()
with lm() there is no problem, but with gls() I get an error:
Error in glsEstimate(glsSt, control = glsEstControl) :
computed gls fit is singular, rank 2
as soon as there are data like this:
> y1 <- c(0,0,0,0)
> x1 <- c(0,1,1.3,0)
> gls(y1~x1)
2009 Sep 22
1
odd (erroneous?) results from gls
A couple weeks ago I posted a message on this topic to r-help, the response
was that this seemed like odd behavior, and that I ought to post it to one
of the developer lists. I posted to r-sig-mixed-models, but didn't get any
response. So, with good intentions, I decided to try posting once more, but
to this more general list.
The goal is (1) FYI, to make you aware of this issue, in case it
2003 Oct 24
2
NLME: gls parameter evaluation inconsistency (PR#4757)
Full_Name: W.B.Kloke
Version: 1.8.0
OS: FreeBSD-4.7
Submission from: (NULL) (195.253.22.63)
I found a parameter evaluation inconsistency in NLME package. I tried to use
gls() inside a function, and I wanted use gls() for different subsets of a data
frame:
prgls <- function(name){ gls( log10(Y)~(cond-1)+(cond-1):t
,pr,subset=subject==name)}
Applying this function with a string as parameter
2010 May 28
1
latex.rms and models fit with GLS
Hi,
I have fit a model using the rms package with the Gls() function.
Is there a way to get the model estimates, std errors, and p-values (i.e. what
you get with print(fit)) into latex format?
I have tried:
f <- Gls(...)
latex(f, file='')
... but I get the following error
Error in replace.substring.wild(s, old, new, test = test, front = front, :
does not handle > 1 * in
2010 Jan 07
1
faster GLS code
Dear helpers,
I wrote a code which estimates a multi-equation model with generalized
least squares (GLS). I can use GLS because I know the covariance matrix of
the residuals a priori. However, it is a bit slow and I wonder if anybody
would be able to point out a way to make it faster (it is part of a bigger
code and needs to run several times).
Any suggestion would be greatly appreciated.
Carlo
2008 May 09
1
Which gls models to use?
Hi,
I need to correct for ar(1) behavior of my residuals of my model. I noticed
that there are multiple gls models in R. I am wondering if anyone
has experience in choosing between gls models. For example, how
should one decide whether to use lm.gls in MASS, or gls in nlme for
correcting ar(1)? Does anyone have a preference? Any advice is appreciated!
Thanks,
--
Tom
[[alternative HTML
2010 Mar 09
1
Computation of AIC for gls models
Dear Colleagues,
We are using the phylog.gls.fit() function from the R package "PHYLOGR" (Diaz-Uriarte R, Garland T: PHYLOGR: Functions for phylogenetically based statistical analyses. 2007. Available at [http://cran.r-project.org/web/packages/PHYLOGR/index.html]) to correct for lack of independence between data points. (In our particular case, the lack of independence is due to
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)
##
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
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 --
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
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
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
2006 Mar 16
2
DIfference between weights options in lm GLm and gls.
Dear R-List users,
Can anyone explain exactly the difference between Weights options in lm glm
and gls?
I try the following codes, but the results are different.
> lm1
Call:
lm(formula = y ~ x)
Coefficients:
(Intercept) x
0.1183 7.3075
> lm2
Call:
lm(formula = y ~ x, weights = W)
Coefficients:
(Intercept) x
0.04193 7.30660
> lm3
Call: