Displaying 4 results from an estimated 4 matches for "ngrp".
Did you mean:
grp
2009 Apr 23
1
ggplot2/aesthetic plotting advice
...t hacks (not quite "jitters", because it's
systematic) the x locations a bit, but I find it a bit
ugly. (I was also hoping that ggplot had some magic
to do this automatically, but position_dodge doesn't
seem to work in this context ...)
Ben Bolker
library(ggplot2)
nx <- 3
ngrp <- 5
nper <- 4
x <- rep(1:nx,ngrp*nper)
y <- runif(nx*ngrp*nper)
g <- factor(rep(1:ngrp,each=nx*nper))
dat <- data.frame(x,y,g)
se <- with(dat,tapply(y,list(g,x),sd)/table(g,x))
means <- with(dat,tapply(y,list(g,x),mean))
limits <- aes(ymax=means+se,ymin=means-se)
gg &l...
2007 Aug 01
1
Problem to remove loops in a routine
...lines per
Trellis plot
nDVID<-nlevels(factor(mydata$DVID)) #number of
DVID=observations types
nidPlot<-nlevels(factor(mydata$PLOT)) #number of items in the
PLOT column
nPer<-nlevels(factor(mydata$OCC)) #number of occassions
(OCC, PER, etc...)
nGRP<-nlevels(factor(mydata$GRP)) #number of groups
pdf(file=paste(myPath,"test.pdf",sep=""))
trellis.par.set(par.main.text=list(cex=1))
trellis.par.set(par.ylab.text=list(font=2))
trellis.par.set(par.xlab.text=list(font=2))
for (i in 1:nidPlot) {...
2013 Feb 26
1
Getting the correct factor level as Dunnett control in glht()
Hello all,
I would like to do a Dunnett test in glht(). However, the factor level I
want to use as the control is not the first.
dunn1<-glht(model3, linfct = mcp(Container = "Dunnett"), alternative =
"less")
The factor container has 8 levels, so it would be nice not to manually
enter in all of the contrasts. I originally discovered glht() when
working with a glm model
2006 Sep 19
0
How to interpret these results from a simple gamma-frailty model
...data samples with a varying degree of heterogeneity (I'm running R 2.3.1, running takes ~1 min).
library(survival); set.seed(10000)
lambda <- 0.01 # Exp. hazard rate
# Beta coefficients for Age,TC,HDLC,SBP,Diab,Smok
beta <- c(0.0483,0.0064,-0.0270,0.0037,0.4284,0.5234)
n <- 1000; Ngrp <- 2; # Nr patients, Nr frailty groups
# Thetas for gamma-frailty
thetaset <- c(1,2,10,100); Ntheta <- length(thetaset);
# Define the simulated population
age <-rnorm(n,48.6,11.7);tc<-rnorm(n,200,30)
hdlc<-rnorm(n,47,6);sbp<-rnorm(n,135,6)
rtmp <- runif(0,1,n=n)...