*************************************************************************************************** ***Stata do file to replicate results presented in the physical activity feedback analysis paper*** *************************************************************************************************** ***The data used in this analysis can be downloaded from the following web link, but data user registration is required before the data can be accessed. ***https://uasdata.usc.edu/index.php?r=eNpLtDKyqi62MrFSKkhMT1WyLrYyNAeyS5NyMpP1UhJLEvUSU1Ly80ASQDWJKZkpUKahoaGpknUtXDB_uxMO ***To run this program, the following three data files are needed. These data files can be downloaded from the above link. ***(1) "feedback_PA_data.dta" ***(2) "lost to follow up analysis.dta" ***(3) "end of day survey data.dta" version 18.0 capture log close log using feedback_analysis,t replace set more off use feedback_PA_data, clear ************************************************************************************************ ***To produce Table 2: Summary statistics of study's participants demographic characteristics*** ************************************************************************************************ preserve duplicates drop uasid, force tab female Experiment, col chi2 tab agecat Experiment, col chi2 tab educat Experiment, col chi2 restore **************************************************************************************************************** ***To produce Table 3: Summary statistics of device wear time data: Average daily device wear time in minutes*** **************************************************************************************************************** ***We made device wear time data available in our data web site**** ***The data file name is "device wear time data.docx"*** ***To get the results preseted in Table 3, just take the average across study days across respondents for each device and experiment*** ***************************************************************************************************** ***To pruduce Table 4: Summary statistics of PA data and quantitative estimate of feedback effect.*** ***************************************************************************************************** sum PA sum PA if fitbit==0 sum PA if fitbit==1 *************************************************************************** ***To produce Table 5: Average PA level multivariate regression analysis.*** *************************************************************************** estimates clear global demo female agecat2 educat2 educat3 global month august september december january february reg PA fitbit $month $demo, vce(cluster uasid) eststo model1 reg PA fitbit $month $demo if dailywear_fitbit>1000| dailywear_geneactiv>1000 , vce(cluster uasid) eststo model2 reg PA fitbit $month $demo if (dailywear_fitbit>1200|dailywear_geneactiv>1200) , vce(cluster uasid) eststo model3 reg PA fitbit $month $demo if (fitbit_1000_days>=5 & geneactiv_1000_days>=5) & (dailywear_geneactiv >1000 | dailywear_fitbit>1000), vce(cluster uasid) eststo model4 reg PA fitbit $month $demo if (dailywear_fitbit>1300|dailywear_geneactiv>1300) , vce(cluster uasid) eststo model5 esttab using Table_5.csv, b(3) se(3) r2(3) pr2 nogap star(* 0.10 ** 0.05 *** 0.01) label br replace /* exporting the regression tables */ ************************************************************************************************************************************************** ***To produce Table A1: Comparison of demographic characteristics (%) between participants and non-participants (i.e., those lost to follow-up)*** ************************************************************************************************************************************************** preserve use "lost to follow up analysis", clear tab female lost_to_follow, col chi2 tab agecat lost_to_follow, col chi2 tab educat lost_to_follow, col chi2 restore ************************************************************************************************** ***To produce Table A2: Summary statistics for end of day survey data across all survey waves.*** ************************************************************************************************* preserve use "end of day survey data.dta" ,clear ***Device takeoff ***Participant reported taking off the device on a given day tab q002 /*fitbit*/ tab q010 /*GENEActiv*/ ***Average number of times reported taking off the device on a given day sum q003 /*Fitbit*/ sum q011 /*GENEActiv*/ ***Device takeoff duration in a given day | taking off (minutes) ***Fitbit take off time in minutes tostring start_year start_month start_day, replace gen var1=start_year + "-"+ start_month + "-" + start_day + " "+ q006a_1_ if !missing( q006a_1_) gen var2=start_year + "-"+ start_month + "-" + start_day + " "+ q006b_1_ if !missing( q006b_1_) gen double var1_c=clock(var1, "YMDhm") format %tc var1_c gen double var2_c=clock(var2, "YMDhm") format %tc var2_c gen fitbit_takeoff_time=(var2_c-var1_c)/1000/60 sum fitbit_takeoff_time if fitbit_takeoff_time>0 ***GENEActiv take off time in minutes gen var3=start_year + "-"+ start_month + "-" + start_day + " "+ q014a_1_ if !missing( q014a_1_) gen var4=start_year + "-"+ start_month + "-" + start_day + " "+ q014b_1_ if !missing( q014b_1_) gen double var3_c=clock(var3, "YMDhm") format %tc var3_c gen double var4_c=clock(var4, "YMDhm") format %tc var4_c gen geneactiv_takeoff_time=(var4_c-var3_c)/1000/60 sum geneactiv_takeoff_time ***Reasons for taking off the device ***Fitbit reasons sum q007_1_s1 q007_1_s2 q007_1_s3 q007_1_s4 q007_1_s5 q007_1_s6 ***GENEActiv reasons sum q013s1 q013s2 q013s3 q013s4 q013s5 ***Any issues wearing the device ***Fitbit sum q008s1 q008s2 q008s3 q008s4 q008s5 q008s6 q008s7 ***GENEActiv sum q016s1 q016s2 q016s3 q016s4 q016s5 ***Checking Physical Activity (applies to Fitbit only) **Checked PA today tab q009 **Frequency of checked PA conditional on checked PA today tab q009a restore ************************************************************************************************************* ***To produce Table A3: Estimated regression coefficients using linear hierarchical random-effects models.*** ************************************************************************************************************* estimates clear global demo female agecat2 educat2 educat3 global month august september december january february mixed PA fitbit $month $demo || uasid: eststo model1 mixed PA fitbit $month $demo if dailywear_fitbit>1000| dailywear_geneactiv>1000 || uasid: eststo model2 mixed PA fitbit $month $demo if (dailywear_fitbit>1200|dailywear_geneactiv>1200) || uasid: eststo model3 mixed PA fitbit $month $demo if (fitbit_1000_days>=5 & geneactiv_1000_days>=5) & (dailywear_geneactiv >1000 | dailywear_fitbit>1000) || uasid: eststo model4 mixed PA fitbit $month $demo if (dailywear_fitbit>1300|dailywear_geneactiv>1300) || uasid: eststo model5 esttab using Table_3A.csv, b(3) se(3) r2(3) pr2 nogap star(* 0.10 ** 0.05 *** 0.01) label br replace log close