/*\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ set more off version 15 * INPUT AND OUTPUT DATA PATHS * location where input data is stored. Change to your directory global in "\\duhs-vclin-nc1\dusom_biostats_fs\data\biostatscore\CRU\SHARE Child\1 - Projects\0 - Cross-sectional Projects\6 - PHQ9 reliability and validity\Data" * location where results are stored global res "\\duhs-vclin-nc1\dusom_biostats_fs\data\biostatscore\CRU\SHARE Child\1 - Projects\0 - Cross-sectional Projects\6 - PHQ9 reliability and validity\Results\PeerJ" * read in input dataset use "$in\phq9scid_anon.dta", clear /* \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ */ *************************************************************************************************************/ *************************************************************************************************************/ /* ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||| INFORMATION FOR FIGURE 1 ||||||||||||||||||||||||| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| */ roctab scid phqTotal, detail graph summary *NOTE: demographic information for table 1 is not provided, as it *is summary data not essential to analysis /* ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||| INFORMATION FOR FIRST SENTENCE OF RESULTS |||||||| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| */ summ phqTotal, detail /* ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||| INFORMATION FOR TABLE 2 |||||||||||||||||||||||||| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| */ tab phqCat scid, col /* ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||| INFORMATION FOR TABLE 3 |||||||||||||||||||||||||| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| */ *ssc install diagt tempname cutoffs postfile `cutoffs' str30 cutoff sens senslb sensub spec speclb specub ppv ppvlb ppvub npv npvlb npvub using "$res\Screening Cutoffs.dta", replace forvalues i=5/20 { capture drop phqDichot`i' gen phqDichot`i' = 1*(phqTotal >= `i' & phqTotal != .) + 0*(phqTotal < `i') diagt scid phqDichot`i' foreach x in sens spec ppv npv { local `x': di %09.1f r(`x') scalar `x' = ``x'' local `x'lb: di %09.1f r(`x'_lb) scalar `x'lb = ``x'lb' local `x'ub: di %09.1f r(`x'_ub) scalar `x'ub = ``x'ub' } scalar cutoff = "`i'" scalar list post `cutoffs' (cutoff) (sens) (senslb) (sensub) (spec) (speclb) (specub) (ppv) (ppvlb) (ppvub) (npv) (npvlb) (npvub) } postclose `cutoffs' preserve use "$res\Screening Cutoffs.dta", clear export excel using "$res\Screening Cutoffs.xlsx", firstrow(varlabels) replace restore /* ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||| INFORMATION FOR TABLE 4 |||||||||||||||||||||||||| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| */ *Internal reliability alpha phq1 - phq9, item std matrix list r(Alpha) putexcel set "$res\screening_alpha.xlsx", replace putexcel A1= matrix(r(Alpha)') putexcel B1=matrix(r(alpha))