if (FALSE) {
# Country averages
head(pmeansNC <- piaac.mean.pv(pvlabel="NUM", by="CNTRYID", data=piaac, export=FALSE))
# plotting country average NUM performance
plot(pmeansNC) + ggtitle("Country performance in NUM")
# without se bars, not good idea
plot(pmeansNC, se=FALSE)
# sorted, thats better
plot(pmeansNC, sort=TRUE)
# Country averages for different age groups
head(pmeansNCA <- piaac.mean.pv(pvlabel="NUM", by=c("CNTRYID", "AGEG10LFS"),
data=piaac, export=FALSE))
#
# plotting country average within
# age groups NUM performance
plot(pmeansNCA, sort=TRUE)
# Country averages for different age and gender groups (changed order)
head(pmeansNCGA <- piaac.mean.pv(pvlabel="NUM", by=c("CNTRYID", "GENDER_R", "AGEG10LFS"),
data=piaac, export=FALSE))
#
# plotting country average within
# age and gender groups NUM performance
plot(na.omit(pmeansNCGA), sort=TRUE)
}
Run the code above in your browser using DataLab