clear capture log close log using "$pathlog\17_Population Breakdown_$S_DATE.log",replace import excel using "L:\Vote Solar\Deliverables\Supplemental\Revised\Exhibit 2-AJL-Revised.xlsx",clear firstrow tab tag_customer,mi keep if tag_customer==1 isid customernumber tab schedule,mi replace schedule=136 if schedule==. tab schedule,mi tab has_monthly_export_delivery,mi tab schedule if has_monthly_export_delivery==1,mi tab lrs,mi tab schedule if lrs==1,mi *Build Across the Export Data* egen export_data=rsum(lrs has_monthly_export_delivery) tab export_data,mi gen no_export_data=export_data==0 tab schedule if no_export_data==1,mi tab residentialorcommercial,mi replace residentialorcommercial="COMMERCIAL" if residentialorcommercial!="RESIDENTIAL" tab residentialorcommercial,mi tab residentialorcommercial if has_monthly_export_delivery==1,mi tab residentialorcommercial if lrs==1,mi tab residentialorcommercial if no_export_data==1,mi preserve collapse (mean) nameplatecapacity,by(residentialorcommercial schedule) order schedule residentialorcommercial nameplatecapacity export excel schedule residentialorcommercial nameplatecapacity using "$pathexcelsurr\Exhibit 4-AJL.xlsx",sheetmodify sheet("Size Comparisons")cell(A2), putexcel set "$pathexcelsurr\Exhibit 4-AJL.xlsx",sheet("Size Comparisons") modify putexcel A1="Schedule", bold putexcel B1="Type of Customer", bold putexcel C1="Name Plate Caapacity", bold restore ttest nameplatecapacity if residentialorcommercial=="RESIDENTIAL",by(schedule) ttest nameplatecapacity if residentialorcommercial=="COMMERCIAL",by(schedule) gen per_end_date="1/1/2020" gen period_end_date=date(per_end_date,"MDY") format period_end_date %tdnn/dd/CCYY gen days_old=period_end_date - installationdate ttest days_old if residentialorcommercial=="RESIDENTIAL",by(schedule) ttest days_old if residentialorcommercial=="COMMERCIAL",by(schedule) preserve collapse (mean) days_old,by(residentialorcommercial schedule) order schedule residentialorcommercial days_old format days_old %20.2fc export excel schedule residentialorcommercial days_old using "$pathexcelsurr\Exhibit 4-AJL.xlsx",sheetmodify sheet("Age Comparisons")cell(A2), putexcel set "$pathexcelsurr\Exhibit 4-AJL.xlsx",sheet("Age Comparisons") modify putexcel A1="Schedule", bold putexcel B1="Type of Customer", bold putexcel C1="Number of Days Old", bold restore log close