Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 3449fac299
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 28 lines (20 sloc) 0.839 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
# let's exclude everybody who reports themselves born after 1994 ( 13 years old
# or younger) or before 1927 (80 years old)

survey.year<- 2007 # or as.numeric(format(Sys.time(),"%Y")) for the next one

Age <- survey.year-X$Year.of.birth
Age[Age < 14] <- NA
Age[Age > 79] <- NA
sd(Age,na.rm=T)
postscript("02-age.ps")
hist(Age,breaks=40)
dev.off()

# here's how we bin the sample into quartiles for further investigation

Age.q1 <- quantile(Age,0.25, na.rm=T)
Age.q2 <- quantile(Age,0.5, na.rm=T)
Age.q3 <- quantile(Age,0.75 na.rm=T)

# so we should be able to report on programming languages known and differences
# by age with this stuff. Here we'll just show how to get the size of each group.

length(Age[Age < Age.q1])
length(Age[Age >= Age.q1 & Age < Age.q2])
length(Age[Age >= Age.q2 & Age < Age.q3])
length(Age[Age >= Age.q3])

Something went wrong with that request. Please try again.