Displaying 4 results from an estimated 4 matches for "dietox".
Did you mean:
detox
2011 Jun 24
0
lag and diff with transformBy
...d, the lag() function generates warnings (but not errors) as the
returned series is truncated to fit within the by-groups.
Again, this appears to be working but I would like to confirm that
it's appropriate use. Thank you very much.
Best regards,
Michael
options(width=140)
library(doBy)
data(dietox)
dietox.ordered <- orderBy(~Evit+Cu+Litter+Time, data=dietox)
dietox.difference <- transformBy(~Evit+Cu+Litter, data=dietox.ordered,
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?lWeight=c(NA,lag(Weight,1)),
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?l4Weight=c(NA,NA,NA,NA,lag(Weight,4)),
? ? ? ? ? ? ? ? ? ? ? ? ?...
2010 Mar 17
2
Using nrow with summaryBy
...re not uniformly distributed) using summaryBy and trying
to add a column with the number of observations to the output as well.
What occurs to me is to use nrow(), but this doesn't appear to be working
I'm able to replicate the same results with an example from the
summaryBy docs:
data(dietox)
dietox12<- subset(dietox,Time==12)
library(doBy)
#this one works
summaryBy(Weight+Feed~Evit+Cu,data=dietox12,FUN=c(mean,var,length))
#adding nrow doesn't give the number of rows
summaryBy(Weight+Feed~Evit+Cu,data=dietox12,FUN=c(mean,var,length,nrow))
There must be a way to do this, but I...
2004 Oct 08
1
Bug in nlme under version 2.0.0
...0.0, I get the error below when calling summary() on a lme-object, whereas it works under version 1.9.1 (well, it did last week, before I upgraded). Any help on this?
Thx in advance
S??ren
> library(nlme)
> mf <- formula(Weight~Cu*(Time+I(Time^2)+I(Time^3)))
> lme1 <- lme(mf, data = dietox, random=~1|Pig)
> summary(lme1)
Linear mixed-effects model fit by REML
Data: dietox
AIC BIC logLik
4748.664 4815.081 -2360.332
Random effects:
Formula: ~1 | Pig
(Intercept) Residual
StdDev: 6.360083 3.116751
Fixed effects: Error in as.vector(x, "list")...
2010 Feb 10
1
using step() with package geepack
...; model object, or perhaps a method for extractAIC based on the QIC of Pan 2001? I see there has been some mention of this on R-help a few years ago (RSiteSearch("QIC")).
The package does provide an anova method for its model objects, and update() seems to work:
library(geepack)
data(dietox) # the example from ?geeglm
# GEE model, using gaussian instead of poisson:
gee1 <- geeglm(Weight~1, data=dietox, id=Pig, family=gaussian, corstr="ar1")
gee2 <- update(gee1, ".~.+Time")
anova(gee1, gee2) # gives a p-value for adding the Time variable
step(gee2, direc...