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] <- 5attach(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)