clear all version 16 set more off cap log close * -------------------------------------------- * * Video Tutorial: Analyzing PIAAC data with Stata * * -------------------------------------------- * * install piaaltools ado ssc install repest, replace help repest * define global paths global data "Stata\2_data\" global log "Stata\3_log\" global out "Stata\5_out\" * use log file log using "${log}Examples_repest.log", replace * -------------------------------------------- * * --------------- ( Video 4: ) --------------- * * --------- ( PIAAC repest macros )----------- * * -------------------------------------------- * * load data use "${data}PIAAC_5Countries.dta" * tabulate countries in the dataset tab cntryid * --- ( Examples descriptive statistics ) ---- * /* 1. Average years of education and literacy skills; overall and by gender */ repest PIAAC, estimate(means yrsqual pvlit@) /// by(cntryid, average(276 300 702 752 840)) repest PIAAC, estimate(means yrsqual pvlit@) /// by(cntryid, average(276 300 702 752 840)) over(gender_r) /* 2. Literacy skill dispersion (5th, 25th, 75th, 95th quantile); overall and for men between 16 and 34 years */ repest PIAAC, /// estimate(summarize pvlit@, stats(p5 p25 p75 p90)) /// by(cntryid, levels(276 752)) repest PIAAC if gender_r == 1 & ageg10lfs == 1, /// estimate(summarize pvlit@, stats(p5 p25 p75 p90)) /// by(cntryid, levels(276 752)) /* 3. Percentages of respondent at each numeracy level, overall and for the employed population */ forv i = 1/10 { gen numlevel`i' = . qui replace numlevel`i' = 1 if pvnum`i' <= 225 qui replace numlevel`i' = 2 if pvnum`i' > 225 & pvnum`i' <= 275 qui replace numlevel`i' = 3 if pvnum`i' > 275 & pvnum`i' <= 325 qui replace numlevel`i' = 4 if pvnum`i' > 325 qui replace numlevel`i' = . if pvnum`i' ==. } repest PIAAC, estimate(freq numlevel@) by(cntryid) /// outfile("${out}repest_Ex3a") repest PIAAC if c_d05 == 1, estimate(freq numlevel@) /// by(cntryid) outfile("${out}repest_Ex3b") * 4. Crosstable of numeracy skills and native language tab nativelang recode nativelang (8/9=.) tab nativelang repest PIAAC, estimate(freq numlevel@) over(nativelang) repest PIAAC, estimate(means pvnum@) over(nativelang, test) /* 5. Correlations between literacy, numeracy, and problem-solving skills */ repest PIAAC, estimate(corr pvlit@ pvnum@ pvpsl@) /// by(cntryid, average(276 300 702 752 840)) * ---------- ( Examples "piaacreg" ) --------- * /* 1. How are age, gender, formal education, and computer experience in the job related to PS-TRE skills? */ fre g_q04 recode g_q04 (1=1) (2=0) repest PIAAC, estimate(stata: reg pvpsl@ i.ageg10lfs gender_r i.edcat6 g_q04) /// by(cntryid) results(add(N r2)) * default: youngest age group & lowest education category = reference groups /* 2. Do literacy skills and formal education determine participation in adult education for women between 35 and 54 years? */ tab nfe12 repest PIAAC, estimate(stata: logistic nfe12 i.edcat6 pvlit@) /// by(cntryid, levels(276 840)) results(add(N r2)) log close