Displaying 20 results from an estimated 4000 matches similar to: "latex.rms and models fit with GLS"
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
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 <-
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
2006 Nov 09
1
Extracting the full coefficient matrix from a gls summary?
Hi,
I am trying to extract the coefficients matrix from a gls summary.
Contrary to the lm function, the command fit$coefficients returns
only the estimates of the model, not the whole matrix including the
std errors, the t and the p values.
example:
ctl <- c(4.17,5.58,5.18,6.11,4.50,4.61,5.17,4.53,5.33,5.14)
trt <- c(4.81,4.17,4.41,3.59,5.87,3.83,6.03,4.89,4.32,4.69)
group <-
2008 Feb 13
1
use of poly()
Hi,
I am curious about how to interpret the results of a polynomial regression--
using poly(raw=TRUE) vs. poly(raw=FALSE).
set.seed(123456)
x <- rnorm(100)
y <- jitter(1*x + 2*x^2 + 3*x^3 , 250)
plot(y ~ x)
l.poly <- lm(y ~ poly(x, 3))
l.poly.raw <- lm(y ~ poly(x, 3, raw=TRUE))
s <- seq(-3, 3, by=0.1)
lines(s, predict(l.poly, data.frame(x=s)), col=1)
lines(s,
2010 Feb 17
1
strangeness in Predict() {rms}
Hi,
Running the following example from ?Predict() throws an error I have never
seen before:
set.seed(1)
x1 <- runif(300)
x2 <- runif(300)
ddist <- datadist(x1,x2); options(datadist='ddist')
y <- exp(x1+ x2 - 1 + rnorm(300))
f <- ols(log(y) ~ pol(x1,2) + x2)
p1 <- Predict(f, x1=., conf.type='mean')
Error in paste(nmc[i], "=", if (is.numeric(x))
2011 Jul 11
1
GLS - Plotting Graphs with 95% conf interval
Hi, I am trying to plot the original data with the line of the model using
the predict function. I want to add SE to the graph, but not sure how to
get them out as the predict function for gls does not appear to allow for
SE=TRUE argument.
Here is my code so far:
f1<-formula(MaxNASC40_50~hu3+flcmax+TidalFlag)
vf1Exp<-varExp(form=~hu3)
B1D<-gls(f1,correlation=corGaus(form=Lat~Lon,
2010 Aug 14
1
confidence Intervals for predictions in GLS
Hi everyone:
Is there a function in R to calculate the confidence intervals for the
predictions of a GLS(Generalized Least Square) model?
The function "predict" gives confidence intervals for the predictions
of other types of models (lm, glm, etc) but not gls.
Any input will be much appreciated,
Best,
Camilo
Camilo Mora, Ph.D.
Department of Biology
Dalhouisie University
2011 Aug 17
1
contrast package with interactions in gls model
Hi!
I try to explain the efffect of (1) forest where i took samples's soils (*
Lugar*: categorical variable with three levels), (2) nitrogen addition
treatments (*Tra*: categorical variable with two levels) on total carbon
concentration's soil samples (*C: *continue* *variable) during four months
of sampling (*Time:* categorical and ordered variable with four levels).
I fitted the
2009 Jan 23
1
lattice: reverse order of panel.lmline, panel.smooth
Hi,
is it possible to reverse the order in which panel.lmline() or panel.smooth()
operation in xyplot() ? This type of situation might occur when plotting some
variable with depth, but the relation we want to describe is variable ~
depth, and not depth ~ variable, as the plotting formula would suggest.
# an example:
d <- 1:100
v <- d * rnorm(100)
xyplot(d ~ v, ylim=c(100,0),
2010 Jul 19
1
possible bug in ape::extract.clade()
Hi,
I was recently splitting some massive phylo class objects with extract.clade()
and noticed what appears to be a bug in how tip labels are copied from the
full tree to the pruned tree. This possible bug was also mentioned here:
http://www.mail-archive.com/r-sig-phylo at r-project.org/msg00537.html
An example:
library(ape)
set.seed(5)
x <- matrix(rnorm(100), ncol=10)
p <-
2010 Dec 24
1
GLS 95% CI
Dear R Gurus,
How do I generate/obtain the 95% CI of the predicted values from the
GLS model? "Not plot.Predict"
Currently I know how to get the 95% CI for the GLS model parameters.
Please advice
Regards
Peter
South Africa
Please Note: This email and its contents are subject to our email legal notice which can be viewed at http://www.sars.gov.za/Email_Disclaimer.pdf
2009 Oct 26
1
Cbind() on the right-side of a formula in xYplot()
Hi,
Using the latest rms package I am able to make nice plots of model predictions
+/- desired confidence intervals like this:
# need this
library(rms)
# setup data
d <- data.frame(x=rnorm(100), y=rnorm(100))
dd <- datadist(d)
options(datadist='dd')
# fit model
l <- ols(y ~ rcs(x), data=d)
# predict along original limits of data
l.pred <- Predict(l)
# plot of fit and
2009 Nov 25
1
Mysterious R script behavior when called from webserver
Hi,
I am trying to transition a system based on dynamic image generation (via R)
from our development system to a production environment. Our R script
functions as expected when run by a regular user. However the script dies
when calling the png() function, when started by the webserver user.
Here are some details
>sessionInfo()
R version 2.9.2 (2009-08-24)
i686-pc-linux-gnu
locale:
C
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
2010 Sep 16
2
parallel computation with plyr 1.2.1
Hi,
I have been trying to use the new .parallel argument with the most recent
version of plyr [1] to speed up some tasks. I can run the example in the NEWS
file [1], and it seems to be working correctly. However, R will only use a
single core when I try to apply this same approach with ddply().
1. http://cran.r-project.org/web/packages/plyr/NEWS
Watching my CPUs I see that in both cases
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 Oct 23
2
interpretation of RCS 'coefs' and 'knots'
Hi,
I have fit a series of ols() models, by group, in this manner:
l <- ols(y ~ rcs(x, 4))
... where the series of 'x' values in each group is the same, however knots
are not always identical between groups. The result is a table of 'coefs'
derived from the ols objects, by group:
group Intercept top top' top''
1 6.864 0.01 2.241 -2.65
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