REQUIRED_TO_FIX (1)

docx

School

Kabarak University *

*We aren’t endorsed by this school

Course

100A

Subject

Statistics

Date

Nov 24, 2024

Type

docx

Pages

23

Uploaded by CountMosquitoPerson827

Report
REQUIRED TO FIX: 1) Your summary statistics tables are non-standard. Create one table for enlisted and one for officers. Then show the means for the entire enlisted population, separately for men and separately for women. The bottom should be number of observations. I created a rough shell of the Table in Excel. Please populate this using your data. a. I recommend showing only these 2 tables in your data chapter, one for officers and another for enlisted. Delete the rest. 2) The description and equation of your logit regression is incorrect, you are estimating separation as a function of an indicator for FIRST-TERM CONTRACT, gender, interaction of IMPR with gender, and other control variables such as…. List them here. See my correction on how you should summarize the logit exercise. a. This is a substantive point, when you look at separation as an outcome, are you including the year the individual joined the USN? You should include a series of indicators for year of enlistment/year of commission as controls. Otherwise, it is hard to interpret your logit regressions. 3) When you discuss the logit results, add the economic significance of the odds ratio. This helps the reader understand the coefficient estimates. 4) Descriptive statistics in Data chapter -- currently Tables 5-7; this is not the way to report summary statistics. As LC suggests, consolidate to a simple/standard descriptive stats table like you’ve seen in all of the papers you review in your Lit Review. Basically, use this shell: 5) Table 7 – is the point of Table 7 to suggest that there are different lengths of service by workgroup because FIRST-TERM CONTRACT lengths varies by workgroup? If this is the point of Table 7, then move it to the Results section to make the point before you move on to regressions. 6) Methods discussion: Make this more standard. When you say you employ method X, describe what is method X and why you use method X. For example, you don’t tell us what is kernel density estimation.
You just say “I use KDE to show ….” Add in equations or further descriptions of each method where appropriate. Add cox and Kaplan-Meier equations and explain how they are used. Bottom line: the standard way to describe methodology is (1) State the method; (2) Define/describe the method using words and equations; (3) Define the variables if you used equations; (4) Describe in words why you use the method you are using in order to answer the research questions; (5) Preview what the limitations of that method are/biases in estimation etc that may not assist you in answering the research question 7) I can see you’ve clarified my earlier concern that the average length of service cannot be inferred from the survival curves (text on page 48). Looking at Figure 8 can be misleading since average LOS is actually longer for those with longer FIRST-TERM CONTRACT. I think that’s why you had your Table 7. Can you weave this narrative together in your Results section? Like, make it coherent. The point to make is: (1) Avg Length of Service varies by FIRST-TERM CONTRACT length. (2) Since different workgroups have different FIRST-TERM CONTRACT, LOS varies by workgroup. (3) Probability of survival varies by FIRST-TERM CONTRACT. (4) Since different workgroups have different FIRST-TERM CONTRACT, survival varies by workgroup. Is that the point you were trying to make with this???? I think it seems like the structure of the Results chapter should be: (1) characterizing lengths of service; (2) Gender differences. If so, then outline should be: A. Length of Service a. Averages/KDE estimates b. Kaplan-Meier estimates B. Gender Differences a. Averages b. Cox models c. Logit/separation THIS IS MY STATA-16 CODE: This is my STATA-16 code: ******************************************************************************** //see what's in the data: describe //N observations summarize // codebook //browse ********************************************************************************
//Label the variables label variable maritalstatusshortdescription "Marital Status" label variable memberwithdependentscode "MWD Code" label variable memberwithdependentsshortdes "Family Status" label variable servicetypecode "Active Service" label variable familycode "Family Code" label variable familyshortdescription "Family Desc" label variable functioncode "Function Code" label variable func_swpa "Function Desc" label variable rankcode "Rank Code" label variable hiredate "Hire Date" label variable rehiredate "Rehire Date" label variable age_group " Age Group" label variable round_los "Length of Service" label variable obl_type_descr "FTC/ROSOS Type" label variable roso_status "ROSO Status" label variable roso_start "ROSO Start Date" label variable roso_end "ROSO End Date" label variable ado_cm_obl_reason "Reason for Separation" label variable ado_dur_years "FTC Length (in years)" label variable ado_dur_months "FTC Length (in months)" label variable ado_dur_days "FTC Length (in days)" label variable separationdate "Separation Date" label variable separationactionreasonshortd "Separation Code" label variable highesteducationlevelcode "Highest Education Level" label variable degreenumber "Tertiary Education" //destring generate commonlaw = strpos(maritalstatuscode,"C") label variable commonlaw "De Facto Marriage" generate married = strpos(maritalstatuscode,"M") label variable married "Married"
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
generate divorced = strpos(maritalstatuscode,"D") label variable divorced "Divorced" generate sep_servreq = strpos(maritalstatuscode,"R") label variable sep_servreq "Member Sep Service Req" generate mseparated = strpos(maritalstatuscode,"E") label variable mseparated "Separated (Marital)" generate single = strpos(maritalstatuscode,"S") label variable single "Single" generate widowed = strpos(maritalstatuscode,"W") label variable widowed "Widowed" generate mwd=(married==1 | commonlaw==1 | sep_servreq==1 | mseparated==1 | nbr_of_dependents==1) label variable mwd "Has dependent(s)" generate agegroup =(age_group== "<20") replace agegroup=2 if age_group== "20-24" replace agegroup=3 if age_group== "25-29" replace agegroup=4 if age_group== "30-34" replace agegroup=5 if age_group== "35-39" replace agegroup=6 if age_group== "40-44" replace agegroup=7 if age_group== "45-49" replace agegroup=8 if age_group== "50-54" replace agegroup=9 if age_group== "55-59" replace agegroup=10 if age_group== "60-64" replace agegroup=11 if age_group== "65-69" /* generate age<20 = strpos(age_group, "<20") label variable age20 "Age less than 20" generate age2024 = strpos(age_group, "20-24")
label variable age2024 "Age 20-24" generate age2529 = strpos(age_group, "25-29") label variable age2529 "Age 25-29" generate age3034 = strpos(age_group, "30-34") label variable age3034 "Age 30-34" generate age3539 = strpos(age_group, "35-39") label variable age3539 "Age 35-39" generate age4044 = strpos(age_group, "40-44") label variable age4044 "Age 40-44" generate age4549 = strpos(age_group, "45-49") label variable age4549 "Age 45-49" generate age5054 = strpos(age_group, "50-54") label variable age5054 "Age 50-54" generate age5559 = strpos(age_group, "55-59") label variable age5559 "Age 55-59" */ generate E00 = strpos(rankcode, "E00") label variable E00 "E00" generate E01 = strpos(rankcode, "E01") label variable E01 "E1" generate E02 = strpos(rankcode, "E02") label variable E02 "E2" generate E03 = strpos(rankcode, "E03") label variable E03 "E3" generate E04 = strpos(rankcode, "E04") label variable E04 "E4" generate E05 = strpos(rankcode, "E05") label variable E05 "E5" generate E06 = strpos(rankcode, "E06")
label variable E06 "E6" generate E08 = strpos(rankcode, "E08") label variable E08 "E8" generate E09 = strpos(rankcode, "E09") label variable E09 "E9" generate E10 = strpos(rankcode, "E10") label variable E10 "E10" generate O00 = strpos(rankcode, "O00") label variable O00 "O0" generate O01 = strpos(rankcode, "O01") label variable O01 "O1" generate O02 = strpos(rankcode, "O02") label variable O02 "O2" generate O03 = strpos(rankcode, "O03") label variable O03 "O3" generate O04 = strpos(rankcode, "O04") label variable O04 "O4" generate O05 = strpos(rankcode, "O05") label variable O05 "O5" generate O06 = strpos(rankcode, "O06") label variable O06 "O6" generate O07 = strpos(rankcode, "O07") label variable O07 "O7" generate O08 = strpos(rankcode, "O08") label variable O08 "O8" generate O09 = strpos(rankcode, "O09") label variable O09 "O9" generate AWA = strpos(func_swpa, "Acoustic Warfare Analyst") generate AEO = strpos(func_swpa, "Aerospace Engineer") generate ATA = strpos(func_swpa, "Air Technician Aircraft")
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
generate ATV = strpos(func_swpa, "Air Technician Avionics") generate AC = strpos(func_swpa, "Aircrew") generate AVN = strpos(func_swpa, "Aviation Support") generate BD = strpos(func_swpa, "Band") generate BM = strpos(func_swpa, "Boatswains Mate") generate CH = strpos(func_swpa, "Chaplain") generate CD = strpos(func_swpa, "Clearance Diver") generate CSO = strpos(func_swpa, "Combat Systems Operator") generate CSO_MW = strpos(func_swpa, "Combat Systems Operator Mine Warfare") label variable CSO_MW "CSO(MW)" generate CIS = strpos(func_swpa, "Communications Information Systems" ) generate CT = strpos(func_swpa, "Cryptologic") generate DA = strpos(func_swpa, "Dental Assistant") generate DN = strpos(func_swpa, "Dentist") generate EW = strpos(func_swpa, "Electronic Warfare" ) generate ET = strpos(func_swpa, "Electronics Technician" ) generate GM = strpos(func_swpa, "General Mariner") generate HSO = strpos(func_swpa, "Hydrographic Systems Operator") generate IW = strpos(func_swpa, "Information Warfare") generate IWO = strpos(func_swpa, "Information Warfare Officer") generate INT = strpos(func_swpa, "Intelligence Officer") generate LO = strpos(func_swpa, "Legal Officer") generate MX = strpos(func_swpa, "Management Executive") generate MEO = strpos(func_swpa, "Marine Engineer") generate MT = strpos(func_swpa, "Marine Technician" ) generate AvWO = strpos(func_swpa, "Maritime Aviation Warfare Officer") generate CW = strpos(func_swpa, "Maritime Cyber Warfare") generate MGO_H = strpos(func_swpa, "Maritime Geospatial Officer (Hydrographer)") label variable MGO_H "MGO(H)" generate MGO_M = strpos(func_swpa, "Maritime Geospatial Officer (Meteorologist/Oceanographer)")
label variable MGO_M "MGO(M)" generate MHRO = strpos(func_swpa, "Maritime Human Resources Officer") generate MLC = strpos(func_swpa, "Maritime Logistics Chef") generate MLO = strpos(func_swpa, "Maritime Logistics Officer") generate MLSC = strpos(func_swpa, "Maritime Logistics Supply Chain" ) generate MLSO = strpos(func_swpa, " Maritime Logistics Support Operations" ) generate MPERS = strpos(func_swpa, "Maritime Personnel") generate MWO = strpos(func_swpa, "Maritime Warfare Officer" ) generate MED = strpos(func_swpa, "Medic" "Medic Submariner") generate MO = strpos(func_swpa, "Medical Officer") generate CDO_MW = strpos(func_swpa, "Mine Warfare Clearance Diving Officer") label variable CDO_MW "CDO(MW)" generate MUSN = strpos(func_swpa, "Musician") generate NPCO = strpos(func_swpa, "Naval Police Coxswain (Officer)") generate NPC = strpos(func_swpa, "Naval Police Coxswain (Sailor)") generate NHSO = strpos(func_swpa, "Navy Health Services Officer") generate NUR = strpos(func_swpa, "Nursing Officer") generate OS = strpos(func_swpa, "Other Sailors") generate PTI = strpos(func_swpa, "Physical Trainer") generate P = strpos(func_swpa, "Pilot") generate PWO = strpos(func_swpa, "Principal Warfare Officer") generate RPWO = strpos(func_swpa, "Remote Pilot Warfare Officer") generate SO = strpos(func_swpa, "Senior Officer") generate TS = strpos(func_swpa, "Training Systems Officer") generate WO_E = strpos(func_swpa, "Warrant Officer (Entry)") generate WON = strpos(func_swpa, "Warrant Officer - Navy") generate WEO = strpos(func_swpa, "Weapons Electrical Engineer" "Weapons Electrical Engineer Submariner") //generate sep_reason = (separationactionreasonshortd=="Com C'trct") //replace sep_reason = 2 if (separationactionreasonshortd=="Mil-Unfit")
//replace sep_reason = 3 if (separationactionreasonshortd=="Mil-Discip") //Make new variables: generate Workgroup =(func_swpa== "Acoustic Warfare Analyst") replace Workgroup = 2 if func_swpa== "Aerospace Engineer" replace Workgroup = 3 if func_swpa== "Air Technician Aircraft" replace Workgroup = 4 if func_swpa== "Air Technician Avionics" replace Workgroup = 5 if func_swpa== "Aircrew" replace Workgroup = 6 if func_swpa== "Aviation Support" replace Workgroup = 7 if func_swpa== "Band" replace Workgroup = 8 if func_swpa== "Boatswains Mate" replace Workgroup = 9 if func_swpa== "Chaplain" replace Workgroup = 10 if func_swpa== "Clearance Diver" replace Workgroup = 11 if func_swpa== "Combat Systems Operator" replace Workgroup = 12 if func_swpa== "Combat Systems Operator Mine Warfare" replace Workgroup = 13 if (func_swpa== "Communications Information Systems" ) replace Workgroup = 14 if (func_swpa== "Cryptologic" ) replace Workgroup = 15 if func_swpa== "Dental Assistant" replace Workgroup = 16 if func_swpa== "Dentist" replace Workgroup = 17 if (func_swpa== "Electronic Warfare") replace Workgroup = 18 if (func_swpa== "Electronics Technician") replace Workgroup = 19 if func_swpa== "General Mariner" replace Workgroup = 20 if func_swpa== "Hydrographic Systems Operator" replace Workgroup = 21 if func_swpa== "Information Warfare" replace Workgroup = 22 if func_swpa== "Information Warfare Officer" replace Workgroup = 23 if func_swpa== "Intelligence Officer" replace Workgroup = 24 if func_swpa== "Legal Officer" replace Workgroup = 25 if func_swpa== "Management Executive" replace Workgroup = 26 if (func_swpa== "Marine Engineer") replace Workgroup = 27 if (func_swpa== "Marine Technician") replace Workgroup = 28 if func_swpa== "Maritime Aviation Warfare Officer"
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
replace Workgroup = 29 if func_swpa== "Maritime Cyber Warfare" replace Workgroup = 30 if func_swpa== "Maritime Geospatial Officer (Hydrographer)" replace Workgroup = 31 if func_swpa== "Maritime Geospatial Officer (Meteorologist/Oceanographer)" replace Workgroup = 32 if func_swpa== "Maritime Human Resources Officer" replace Workgroup = 33 if (func_swpa== "Maritime Logistics Chef") replace Workgroup = 34 if func_swpa== "Maritime Logistics Officer" replace Workgroup = 35 if (func_swpa== "Maritime Logistics Supply Chain") replace Workgroup = 36 if (func_swpa== "Maritime Logistics Support Operations") replace Workgroup = 37 if func_swpa== "Maritime Personnel" replace Workgroup = 38 if (func_swpa== "Maritime Warfare Officer") replace Workgroup = 39 if (func_swpa== "Medic") replace Workgroup = 40 if func_swpa== "Medical Officer" replace Workgroup = 41 if func_swpa== "Mine Warfare Clearance Diving Officer" replace Workgroup = 42 if func_swpa== "Musician" replace Workgroup = 43 if func_swpa== "Naval Police Coxswain (Officer)" replace Workgroup = 44 if func_swpa== "Naval Police Coxswain (Sailor)" replace Workgroup = 45 if func_swpa== "Navy Health Services Officer" replace Workgroup = 46 if func_swpa== "Nursing Officer" replace Workgroup = 47 if func_swpa== "Other Sailors" // DROP replace Workgroup = 48 if func_swpa== "Physical Trainer" replace Workgroup = 49 if func_swpa== "Pilot" replace Workgroup = 50 if func_swpa== "Principal Warfare Officer" //DROP replace Workgroup = 51 if func_swpa== "Remote Pilot Warfare Officer" replace Workgroup = 52 if func_swpa== "Senior Officer" //? DROP replace Workgroup = 53 if func_swpa== "Training Systems Officer" replace Workgroup = 54 if func_swpa== "Warrant Officer (Entry)" //DROP replace Workgroup = 55 if func_swpa== "Warrant Officer - Navy" //DROP replace Workgroup = 56 if (func_swpa== "Weapons Electrical Engineer") drop if (func_swpa=="Warrant Officer (Entry)" | func_swpa=="Warrant Officer - Navy" | func_swpa== "Senior Officer") //63 obs dropped
drop if missing(gendercode) //13,098 changes generate female=0 replace female=1 if gendercode== "F" //Female= 6,247 and M= 20,205 label variable female "Female" generate FTC=0 if descr=="Non-FTC" replace FTC=1 if ado_dur_years==1 replace FTC=2 if ado_dur_years==2 replace FTC=3 if ado_dur_years==3 replace FTC=4 if ado_dur_years==4 //replace FTC=5 if ado_dur_years==5 replace FTC=6 if ado_dur_years==6 replace FTC=8 if ado_dur_years==8 replace FTC=9 if ado_dur_years==9 replace FTC=11 if ado_dur_years==11 replace FTC=12 if ado_dur_years==12 replace FTC=14 if ado_dur_years==14 label variable FTC "FTC Length" generate enlisted=(o_or=="OR") //20,620 changes label variable enlisted "Enlisted" generate officer=(o_or=="O") label variable officer "Officer" generate enlistFTC= 0 if (FTC==0 | FTC==1) & enlisted==1 replace enlistFTC=2 if FTC==2 & enlisted==1 //202 changes replace enlistFTC=3 if FTC==3 & enlisted==1 //241 changes replace enlistFTC=4 if FTC==4 & enlisted==1 //6,127 changes
replace enlistFTC=6 if FTC==6 & enlisted==1 //9,477 changes /* generate fem_enlistFTC= 0 if (FTC==0 | FTC==1) & enlisted==1 & female==1 //949 obs replace fem_enlistFTC=2 if FTC==2 & enlisted==1 & (ATA==1 | ATV==1 | ET==1 | MT==1) //202 changes replace fem_enlistFTC=4 if FTC==4 & female==1 & (ATA==1 | ATV==1 | ET==1 | MT==1) //19 changes replace fem_enlistFTC=6 if FTC==6 & enlisted==1 & (ATA==1 | ATV==1 | ET==1 | MT==1) //1,954 changes */ generate offFTC= 0 if FTC==0 & officer==1 //710 changes replace offFTC=3 if FTC==3 & officer==1 //459 changes replace offFTC=6 if FTC==6 & officer==1 //1,504 changes replace offFTC=8 if FTC==8 & officer==1 //119 changes replace offFTC=9 if FTC==9 & officer==1 //1,221 changes replace offFTC=11 if FTC==11 & officer==1 //82 changes replace offFTC=12 if FTC==12 & officer==1 //41 changes replace offFTC=14 if FTC==14 & officer==1 //88 changes generate sep=0 if missing(separationdate) replace sep=1 if sep!=0 //11,957 changes generate sep_age=0 if sep==0 replace sep_age= 1 if sep==1 & (age_group=="<20") replace sep_age= 2 if sep==1 & (age_group=="20-24") replace sep_age= 3 if sep==1 & (age_group=="25-29") replace sep_age= 4 if sep==1 & (age_group=="30-34") replace sep_age= 5 if sep==1 & (age_group=="35-39") replace sep_age= 6 if sep==1 & (age_group=="40-44") replace sep_age= 7 if sep==1 & (age_group=="45-49")
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
replace sep_age= 8 if sep==1 & (age_group=="50-54") replace sep_age= 9 if sep==1 & (age_group=="55-59") replace sep_age= 10 if sep==1 & (age_group=="60-64") replace sep_age= 11 if sep==1 & (age_group=="65-69") generate los_mth = ((separationdate - hiredate)/12) //14,495 changes (if I don't drop missing gendercode, then it's 27,593 changes) //replace los_mth = ((d(31may2023) - hiredate)/12) if missing(los) //14,495 changes label variable los_mth "Length of Service (in months)" label variable round_los "Length of Service (to nearest year)" generate los = ((separationdate - hiredate)/365) label variable los "Length of Service (in years)" generate missing_educ=(degreenumber==.) replace degreenumber=0 if degreenumber==. //35,952 changes generate FTCmonth=((roso_end - roso_start)/12) //missing 65 obs because don't have record of FTC or ROSO generate FTCyear=((roso_end - roso_start)/365) //missing 65 obs because don't have record of FTC or ROSO //see those who did not finish their FTC: generate sep_dur_FTC = 0 //replace sep_dur_FTC = 1 if (separationdate - hiredate)<(roso_end - roso_start) //1,133 changes replace sep_dur_FTC= separationdate<(hiredate+(FTC*365)) replace sep_dur_FTC=. if roso_end>td(31may2023) generate enlist_sep_dur_FTC = 0 if enlisted==1 replace enlist_sep_dur_FTC= separationdate<(hiredate+(FTC*365)) if enlisted==1 replace enlist_sep_dur_FTC=. if roso_end>td(31may2023)
generate off_sep_dur_FTC = 0 if enlisted==0 replace off_sep_dur_FTC= separationdate<(hiredate+(FTC*365)) if enlisted==0 replace off_sep_dur_FTC=. if roso_end>td(31may2023) generate still_on_FTC=0 replace still_on_FTC=1 if (obl_type_descr=="FTC - Officer" | obl_type_descr=="FTC - Other Ranks") & roso_status!="C" ******************************************************************************** // 1 Summary Tables: tabstat enlisted officer sep_dur_FTC still_on_FTC round_los female agegroup degreenumber mwd, /// by(func_swpa) stat(N mean sd) col(stat) long save ******************************************************************************** //2 sts graph *KM stset los, failure(sep) sts graph, survival by(female) /// xtitle("Length of Service", size(small)) graphregion(color(white)) /// plot1opts(lcolor(purple) lpattern(longdash)) plot2opts(lcolor(blue)) /// ytitle("Percentage Still on Active Duty", size(small)) /// xlabel(0(5)45) title("Kalpan-Meier Survival Estimates by Gender", size(medium)) /// legend(order(1 "Male" 2 "Female"))
graph export km_all_FvM.pdf, replace sts graph, survival by(enlisted) /// xtitle("Length of Service" , size(small)) xlabel(0(5)40) graphregion(color(white)) /// plot1opts(lcolor(purple) lpattern(longdash)) plot2opts(lcolor(blue)) /// ytitle("Percentage Still on Active Duty" , size(small)) /// title("Survival Estimates of Active Duty Personnel", size(medium)) /// legend(order(1 "Officer" 2 "Enlisted")) graph export km_all_enlistvOff.pdf, replace /* //check to see what curves will look like on an x-scale that goes all the way out (to 48 years) sts graph, survival by(enlistFTC) sts graph, survival by(offFTC) */ stset los, failure(sep) sts graph if offFTC!=0 & los<15, survival by(offFTC) /// graphregion(color(white)) /// plot1opts(lcolor(blue)) plot2opts(lcolor(purple) lpattern(longdash)) plot3opts(lcolor(green) lpattern(dash)) plot4opts(lcolor(red) lpattern(shortdash_dot)) plot5opts(lcolor(orange) lpattern(longdash_dot)) plot6opts(lcolor(black) lpattern("-")) /// xtitle(Length of Service) xlabel(0(2)14) /// legend(label (1 "3-yr FTC") label (2 "6-yr FTC") label (3 "8-yr FTC") label (4 "9-yr FTC") label (5 "11-yr FTC") label (6 "12-yr FTC") label (7 "14-yr FTC") col(5) size(small) region(lstyle(none)) ) /// title("Officers FTC", size(medium)) graph export FTC_officer.pdf, replace //put the sts graph into a table for kep points: sts list if offFTC!=0 , survival by(offFTC) risktable(3 6 8 9 11 12 14) sts list, by(offFTC) risktable(3 6 8 9 11 12 14) sts test offFTC //log-rank test for equality of survivor functions - Check if the K-M distributions are significantly different by doing Kolmogorov-Smirnov test
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
//ksmirnov? no need - you did the log-rank test thingy - sts test sts graph if los<7, survival by(enlistFTC) /// graphregion(color(white)) /// plot1opts(lcolor(black) lpattern(longdash_dot)) plot2opts(lcolor(blue)) plot3opts(lcolor(purple) lpattern(longdash)) plot4opts(lcolor(green) lpattern(dash)) plot5opts(lcolor(red) lpattern(shortdash_dot)) /// xtitle(Length of Service) xlabel(0(2)6) ymlabel(##2) xmtick(##2) /// legend(label (1 "< 2-yr FTC") label (2 "2-yr FTC") label (3 "3-yr FTC") label (4 "4-yr FTC") label (5 "6-yr FTC") col(5) size(small) region(lstyle(none)) ) /// title("Enlisted FTC", size(medium)) graph export all_FTC_enlist.pdf, replace //put the sts graph into a table for kep points: sts list, by(enlistFTC) risktable(1 2 3 4 6) //with 1-yr and less FTC //sts list if enlistFTC!=0 , survival by(enlistFTC) risktable(0 1 2 3 4 6) sts test enlistFTC //log-rank test for equality of survivor functions - Check if the K-M distributions are significantly different by doing Kolmogorov-Smirnov test sts graph if (enlistFTC==2 | enlistFTC==4 | enlistFTC==6) & female==1 & los<7, survival by(enlistFTC) /// graphregion(color(white)) /// plot1opts(lcolor(blue)) plot2opts(lcolor(green) lpattern(dash)) plot3opts(lcolor(red) lpattern(shortdash_dot)) /// xtitle(Length of Service) xlabel(0(2)6) ytitle(Prob of Separating) xmtick(##2) /// legend(label (1 "2-yr") label (2 "4-yr") label (3 "6-yr") col(5) size(small) region(lstyle(none))) /// title("Enlisted Female given Reduced FTC option", size(medium)) graph export female_enlist_2v4v6.pdf, replace sts list if (enlistFTC==2 | enlistFTC==4 | enlistFTC==6) & female==1 & los<7, /// survival by(enlistFTC) risktable(2 4 6) sts test enlistFTC if (enlistFTC==2 | enlistFTC==4 | enlistFTC==6) & female==1 & los<7
******************************************************************************** *Cox stcox female agegroup mwd degreenumber if enlistFTC==2 & los<7 stcurve, survival at(female=(1 0)) lpattern(solid dash) xlabel(0(2)7) xtitle("Length of Service") ytitle("Percentage Still on Active Duty") graphregion(color(white)) title("Enlisted 2-yr FTC", size(medium)) legend(order(1 "Female" 2 "Male")) graph export female_enlist_2.pdf, replace stcox female agegroup mwd degreenumber if enlistFTC==3 & los<7 stcurve, survival at(female=(1 0)) lpattern(solid dash) xlabel(0(2)7) xtitle("Length of Service") ytitle("Percentage Still on Active Duty") graphregion(color(white)) title("Enlisted 3-yr FTC", size(medium)) legend(order(1 "Female" 2 "Male")) graph export female_enlist_3.pdf, replace stcox female agegroup mwd degreenumber if enlistFTC==4 & los<7 stcurve, survival at(female=(1 0)) lpattern(solid dash) xlabel(0(2)7) xtitle("Length of Service") ytitle("Percentage Still on Active Duty") graphregion(color(white)) title("Enlisted 4-yr FTC", size(medium)) legend(order(1 "Female" 2 "Male")) graph export female_enlist_4.pdf, replace stcox female agegroup mwd degreenumber if enlistFTC==6 & los<7 stcurve, survival at(female=(1 0)) lpattern(solid dash) xlabel(0(2)7) xtitle("Length of Service") ytitle("Percentage Still on Active Duty") graphregion(color(white)) title("Enlisted 6-yr FTC", size(medium)) legend(order(1 "Female" 2 "Male")) graph export female_enlist_6.pdf, replace stcox female agegroup mwd degreenumber if offFTC==3 & los<15 stcurve, survival at(female=(1 0)) lpattern(solid dash) xlabel(0(2)15) xtitle("Length of Service") ytitle("Percentage Still on Active Duty") graphregion(color(white)) title("Officer 3-yr FTC", size(medium)) legend(order(1 "Female" 2 "Male")) graph export female_officer_6.pdf, replace
stcox female agegroup mwd degreenumber if offFTC==6 & los<15 stcurve, survival at(female=(1 0)) lpattern(solid dash) xlabel(0(2)15) xtitle("Length of Service") ytitle("Percentage Still on Active Duty") graphregion(color(white)) title("Officer 6-yr FTC", size(medium)) legend(order(1 "Female" 2 "Male")) graph export female_officer_6.pdf, replace stcox female agegroup mwd degreenumber if offFTC==9 & los<15 stcurve, survival at(female=(1 0)) lpattern(solid dash) xlabel(0(2)15) xtitle("Length of Service") ytitle("Percentage Still on Active Duty") graphregion(color(white)) title("Officer 9-yr FTC", size(medium)) legend(order(1 "Female" 2 "Male")) graph export female_officer_9.pdf, replace stcox female agegroup mwd degreenumber if offFTC==11 & los<15 stcurve, survival at(female=(1 0)) lpattern(solid dash) xlabel(0(2)15) ytitle("Percentage Still on Active Duty") graphregion(color(white)) title("Officer 11-yr FTC", size(medium)) legend(order(1 "Female" 2 "Male")) graph export female_officer_11.pdf, replace /* too small to give any good data stcox female agegroup mwd degreenumber if offFTC==12 & los<15 stcurve, survival at(female=(1 0)) lpattern(solid dash) xlabel(0(2)15) ytitle("Percentage Still on Active Duty") graphregion(color(white)) title("Officer 12-yr FTC", size(medium)) graph export female_officer_12.pdf, replace stcox female agegroup mwd degreenumber if offFTC==14 & los<15 stcurve, survival at(female=(1 0)) lpattern(solid dash) xlabel(0(2)15) ytitle("Percentage Still on Active Duty") graphregion(color(white)) title("Officer 14-yr FTC", size(medium)) graph export female_officer_14.pdf, replace */ stcox female agegroup mwd if enlistFTC==2 & los<7 stcox female agegroup mwd if enlistFTC==3 & los<7 stcox female agegroup mwd if enlistFTC==4 & los<7
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
stcox female agegroup mwd if enlistFTC==6 & los<7 stcurve, survival at(female=(1 2)) lpattern(solid dash dot) xlabel(0(2)7) graphregion(color(white)) legend(order(1 "Female" 2 "Male")) title("Cox Proportional Hazards Regression for Female Emlisted Sailors", size(medium)) //to compare odds of sep btw short and long FTC for females: //gen short_enlist = enlistFTC==2 //gen long_enlist = enlistFTC==6 //stcox female##(short_enlist long_enlist) agegroup mwd degreenumber stcox i.enlistFTC if female==1 & los<7 //the haz ratio gives me the odds of sep in short vs long FTC outreg2 using "C:\Users\methy\Documents\NPS\Thesis\Data\cox_test_ienlist_female.doc", replace stcurve, at(female==1) at(female==0) survival title("Cox Proportional Hazards Regression - Short vs Long FTC", size(medium)) xtitle(Length of Service) ytitle("Percentage Still on Active Duty") test 2.enlistFTC=6.enlistFTC outreg2 using "C:\Users\methy\Documents\NPS\Thesis\Data\cox_test_enlist.doc", replace stcox i.offFTC if female==1 //the haz ratio gives me the odds of sep in short vs long FTC //stcurve, survival at(female=(1 2)) test 3.offFTC=11.offFTC outreg2 using "C:\Users\methy\Documents\NPS\Thesis\Data\cox_test_off.doc", replace ******************************************************************************** //3 sep rates: gen sep_rate = sep * 100 tabstat sep_rate female enlisted officer, by(FTC) statistics(mean) outreg2 using "C:\Users\methy\Documents\NPS\Thesis\Data\sum_sep_rate.doc", replace generate female_FTC=(female*FTC)
logit sep female i.FTC i.female_FTC outreg2 using "C:\Users\methy\Documents\NPS\Thesis\Data\logit.doc", replace eststo clear eststo log_tab: logit sep female i.FTC#i.female esttab log_tab using log_table.rtf, /// replace stats(year N r2) se(a) b(a) label compress onecell /// mgroups("Separation Rates", pattern(0 1 0 0 0)) /// nomtitle /// title("Logit zone.") ******************************************************************************** ******************************************************************************** ******************************************************************************** ******************************************************************************** //T Test: when null is mean(sep) if FTC=(small) year == to mean(sep) if FTC=(larger), then: ttest sep if female==1 & (enlistFTC==2 | enlistFTC==3), by(enlistFTC) ttest sep if female==1 & (enlistFTC==2 | enlistFTC==4), by(enlistFTC) ttest sep if female==1 & (enlistFTC==2 | enlistFTC==6), by(enlistFTC) /* my hypothesis is: Ho:There is no difference in means for sep (diff = 0). Ha: The mean for sep of Group 2 is less than the mean for sep of Group 6 (Ha: diff < 0). interpretation of the results: -The mean separation rate for Group 2 (enlistFTC == 2) is 0.246988, while for Group 6 (enlistFTC == 6) it is 0.640296. -The mean difference (diff) is -0.393308, suggesting that Group 2 has a significantly lower mean separation rate than Group 6.
-The p-values are all very close to zero, indicating strong evidence against the null hypothesis. Therefore, I reject the null hypothesis and conclude that there is a significant difference in the mean separation rates between the two groups. */ //when null is los if los_yr=1 is not the same one form los if los_yr=2, which is different from los if los_yr=3 etc. then: //table FTCyear enlisted, statistic(mean sep_rate) stars //how to get this to work?????? ************************************************** //kdensity graph: set scheme white_tableau //set the fancy graph theme twoway kdensity los if enlisted==1, by(female) /// graphregion(color(white)) xtitle("Length of Service") ytitle("Density") title("Enlisted") xlabel(0(10)45) || kdensity los if enlisted==0, by(female) graphregion(color(white)) xtitle("Length of Service") xlabel(0(10)45) /// legend(label (1 "Female") label (2 "Male") col(5) size(small) region(lstyle(none)) ) //this shows two graphs, one for officer and one for enlisted, with curves for males and females along the los. twoway (kdensity los if enlistFTC==2 & female==1, legend(label(1 "2-yr FTC"))) || /// (kdensity los if enlistFTC==4 & female==1, legend(label(2 "4-yr FTC"))) || /// (kdensity los if enlistFTC==6 & female==1, legend(label(3 "6-yr FTC"))) || //this is the graph for female-specific FTC and how they serve ttest los, by(enlisted) unequal //this t-test is evaluating whether the mean length of service is significantly different between enlisted and officer females. The p-values are very small, indicating strong evidence against the null hypothesis. Therefore, you can conclude that there is a significant difference in the mean length of service between enlisted and officers. In this case, the mean length of service is significantly higher for the officers compared to the enlisted group.
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
ttest los if female==1, by(enlisted) unequal // t-test is evaluating whether the mean length of service is significantly different between enlisted and officer females. The p-values are small, indicating evidence against the null hypothesis. Therefore, you can conclude that there is a significant difference in the mean length of service between enlisted and officer females. In this case, the mean length of service is significantly higher for officers females compared to enlisted females. ttest los if enlistFTC!=0, by(enlisted) unequal // /* Difference in Means: Difference in Means (diff): 2.379918 Standard Error for the Difference: 0.2111703 95% Confidence Interval for the Difference: (1.965773, 2.794063) Test Statistic and Significance: t-Statistic (t): 11.2701 Ho: the difference in means is zero. Ha are: Ha: diff < 0 (one-tailed test for Group 0 having a larger mean) Ha: diff != 0 (two-tailed test for any difference) Ha: diff > 0 (one-tailed test for Group 1 having a larger mean) p-values for the tailed tests: Pr(T < t) = 1.0000, Pr(|T| > |t|) = 0.0000, Pr(T > t) = 0.0000 Interpretation: this t-test is evaluating whether the mean length of service is significantly different between enlisted and officers groups, excluding those with enlistFTC equal to 0. The p-values are very small, indicating strong evidence against the null hypothesis. Therefore, you can conclude that there is a significant difference in the mean length of service between enlisted and officers, excluding those with enlistFTC equal to 0. In this case, the mean length of service is significantly higher for non-enlisted individuals compared to enlisted individuals. */ ttest los if offFTC!=0, by(officer) unequal // /* Difference (Mean 0 - Mean 1):
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
Difference in means: -2.38 years (non-officers have a lower mean length of service) Standard Error of the Difference: 0.211 years 95% Confidence Interval for the Difference: [-2.79, -1.96] T-statistic: -11.25 Hypothesis Testing: Ho: The mean length of service is the same for officers and non-officers. Ha: The mean length of service is different for officers and non-officers. Interpretation: The p-value is very close to zero, indicating strong evidence to reject the null hypothesis. Therefore, there is a significant difference in the average length of service between officers and non-officers. Officers tend to have a higher mean length of service compared to non-officers. */
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help