Why is it so hard to make a straightforward twoway table of means in R?

I mean, this code works, but it gives you the number, not the *table*, which would greatly reduce the cutting and pasting…

allchildren = read.csv(“C:\\Data\\Econ 135 Gender\\ps_1__all_children.csv”)
names(allchildren )
allchildren$recent <- as.numeric(decadeborn >75)
chsizenew  <- chsize
chsizenew[chsize>= 5] <- 5

attach(allchildren )
options(digits=3)
library(doBy) # you have to first install the package doBy
summaryBy(agediffm  ~ recent+ isboy, data=allchildren , FUN=c(mean),na.rm=TRUE)
summaryBy(agediffm  ~ recent+ firstb, data=allchildren , FUN=c(mean),na.rm=TRUE)
summaryBy(agediffm  ~ recent+ atlst1bn , data=allchildren , FUN=c(mean),na.rm=TRUE)
summaryBy(chsizenew ~ recent+ gender , data=allchildren , FUN=c(mean),na.rm=TRUE)

Unknown's avatar

About mkevane

Economist at Santa Clara University and Director of Friends of African Village Libraries.
This entry was posted in Burkina Faso. Bookmark the permalink.