search for: fitlm

Displaying 11 results from an estimated 11 matches for "fitlm".

Did you mean: film
2006 Nov 09
1
Extracting the full coefficient matrix from a gls summary?
...t 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 <- gl(2,10,20, labels=c("Ctl","Trt")) weight <- c(ctl, trt) fitlm<-lm(weight~group) summary(fitlm)$coefficients ### returns estimates, std errors, t values and Pr(>|t|) fitgls<-gls(weight~group) summary(fitgls)$coefficients ### returns only the estimates. I would like to be able to extract the whole coefficient matrix form the gls. Any ideas how I co...
2006 Jan 11
3
how to obtain "par(ask=TRUE)" with trellis-plots
Dear alltogether, how can a delay like possible with par(ask=TRUE) be attained while using trellis-plots within a loop or something like that? the following draws each plot without waiting for a signal (mouse-klick), so par() does not work for that: library(nlme) for(i in 1:3) { fitlme <- lme(Orthodont) par(ask=TRUE) # does not work with trellis.... print( plot(augPred(fitlme)) ) } thanks, leo -- email: leog at anicca-vijja.de www: http://www.anicca-vijja.de/
2012 Nov 07
5
Calling R object from R function
Hi, Can you please help me with this please? What I am trying to do is call a vector from R function and used in the new function So I create 4 functions with these arguments M11 <- function(TrainData,TestData,mdat,nsam) { ls <- list() I have few statments one of them is vectx <- c(,1,2,3,4,5,6,6) vectz <- c(12,34,5,6,78,9,90) and then................ ls(vectx=vtecx,vectz=vectz)
2007 Jan 12
2
Magnitude of trend in time series
Hello, I am analyzing some climate time series data using the Mann Kendall package and was wondering if there was a way to calculate the trend using Sen's nonparametric estimator slope in R? Thank you in advance, Barry _________________________ Barry Baker, Ph.D. Global Climate Change Initiative The Nature Conservancy 2424 Spruce St., Suite 100 Boulder, CO 80302 Tel: (303)-541-0322 Fax:
2010 Mar 15
3
the problem about sample size
Hi all: I am a user of "JM" package. Here's the problem of "sample size". The warning is: Error in jointModel(fitLME, fitSURV_death, timeVar = "time", method = "piecewise-PH-GH") : sample sizes in the longitudinal and event processes differ. According to the suggestion of "missing data",I use the same data set(data_JM) without any missing value. fitLME <- lme(CD4 ~ time +...
2012 Oct 05
0
jointModel error messages
...I am trying to use the jointModel function in the JM package to fit a > simple joint model to longitudinal and survival data. > I have come accross a range of errors when trying different things and > just can't seem to get around them all. > > The code I use is as follows: > fitLME = lme(cd4~trt+time, random=~time|num, data=mnuts2); summary(fitLME) > fitSURV = coxph(Surv(fail.time, SI.code)~trt, x=TRUE, data=cov); > summary(fitSURV) > fitJM = jointModel(fitLME, fitSURV, timeVar="time", > method="piecewise-PH-GH"); summary(fitJM) > > Bot...
2005 Dec 12
2
convergence error (lme) which depends on the version of nlme (?)
Dear list members, the following hlm was constructed: hlm <- groupedData(laut ~ design | grpzugeh, data = imp.not.I) the grouped data object is located at and can be downloaded: www.anicca-vijja.de/lg/hlm_example.Rdata The following works: library(nlme) summary( fitlme <- lme(hlm) ) with output: ... AIC BIC logLik 425.3768 465.6087 -197.6884 Random effects: Formula: ~design | grpzugeh Structure: General positive-definite StdDev Corr (Intercept) 0.3772478 (Intr) dsgn:8 dsgn:7 designmit:8 0.6776543 0.183...
2012 Nov 16
2
R-Square in WLS
...SSE and I dont know what I am coding wrong. Can you help please? xnam <-colnames(X) # colnames Design Matrix fmla1 <- as.formula(paste("Y ~",paste(xnam, collapse= "+"),"-1",sep="")) fitlm <- lm(formula=fmla1,data = data.frame(cbind(X,Y))) ResiSqr <- (residuals(fitlm))*(residuals(fitlm)) fmla2 <- as.formula(paste("ResiSqr ~ ", paste(xnam, collapse= "+"),"-1",sep="")) fitResi <- lm(formula=fmla2,data = data.frame(cbind(x,ResiSqr))) #...
2011 Nov 22
0
plotting output from LME with natural cubic spline
...This model has run without any problem, but now I would like to plot trajectories for subjects using their fitted random effects and incorporating the shape of the natural cubic spline. I am able to plot a point for each subject's fitted random effect score at the time the outcome was measured (fitLME$fitted[,2]). However, I cannot figure out how to connect the points to reflect the natural cubic spline. Does anyone know how to do this using output produced in the LME model object (e.g., fixed or random model coefficients) ? Code: fitLME<-lme(Y~ns(time, df=4), random=list(id = pdDiag(f...
2007 Sep 12
0
constructing an lm() formula in a function
...6 -1.8069 ... > str(can1$terms) chr [1:2] "Block" "Gp" OK, so now in a function I want to do the equivalent of fitting lm( cbind(Can1, Can2, ... Can9) ~ Block+Gp, data=can$scores) The following function shows two ways I've tried to do this, neither of which works: fitlm.candisc <- function( can ) { factors <- can$factors # factor variable from candisc terms <- can$terms # terms from original lm scores <- can$scores # scores data fram # can.mod <- lm(as.matrix(scores[,paste("Can",1:can$rank,se...
2003 Jan 29
1
Scoping rule problem -- solved
Thanks to some comments from Brian D. Ripley, I found my error: I should not have given a data argument to lm() after creating a formula-object. This obviously confused things... Thanks again, I've really learnt again a bit more on R-programming... Cheers, Winfried --------------------------------------------------------------------- E-Mail: Winfried Theis <theis at