search for: summaryfn

Displaying 2 results from an estimated 2 matches for "summaryfn".

Did you mean: summary
2010 Dec 22
1
Seeking feedback on my first attempt at R programming
....92 ")   fev <- data.frame(scan(connection,  list(patno = 0, trtgrp = "", fev0 = 0, fev6 = 0), na.strings="<NA>"))   fev <- within(fev,trtgrp <- factor(trtgrp, labels = c("ABC-123","Placebo"))) fev <- within(fev,chg <- fev6 - fev0)   summaryfn <- function(x)  data.frame(n=sum(complete.cases(x)),mean=mean(x),std.dev=sd(x), t.value=mean(x)/(sd(x)/sqrt(sum(complete.cases(x)))), p.value=2*pt(-abs(mean(x)/(sd(x)/sqrt(sum(complete.cases(x))))),df=sum(complete.cases(x))-1))   cfev <- na.omit(fev) by(cfev[3:5],cfev[2],summaryfn)   fligner....
2011 Mar 01
1
Pairwise T-Tests and Dunnett's Test (possibly using multcomp)
...  .  117 PB 33 118 PB 37  122 PB 25 126 PB 28  129 PB 26 132 PB  .  133 PB 31 134 PB 27  139 PB 30 144 PB 25  145 PB 22 147 PB 36  149 PB 32 ")   gad <- data.frame(scan(connection,    list(patno=0,dosegrp="",hama=0),na.strings="."))   gad   #### Summary Statistics ####   summaryfn <- function(x) data.frame(    mean=mean(x,na.rm=T),std.dev=sd(x,na.rm=T),n=sum(!is.na(x)))   by(gad$hama,gad$dosegrp,summaryfn)   #### ANOVA ####   model1 <- aov(hama~dosegrp,data=gad) summary.aov(model1)   #### Multiple Comparisons ####   library(multcomp)   #### Pairwise T-Tests ####   cht...