Milestone Two will assist you in preparing for you for the Final Project. In Milestone One, you performed a preliminary
Posted: Tue Jul 12, 2022 8:15 am
Milestone Two will assist you in preparing for you for the FinalProject. In Milestone One, you performed a preliminary dataassessment. In this milestone, you will begin your analysis of thedata in earnest by using RStudio to validate the data assessmentyou performed in Milestone One and to discover new information.Prompt: Based on your findings from your preliminary dataassessment (Milestone One), you will perform the following stepsand commands to continue your analysis of the firefighter andpolice data. This time the data has been separated out for you intotwo different files: DAT 500 Milestone Two Data - Firefighter andDAT 500 Milestone Two Data - Police. Inside the Codio moduleMilestone Two, these files are located in the directory~workspace/SNHU/DAT500/Milestones In order to complete MilestoneTwo, you must first: Move files: Utilize the command line interfaceto copy the following files to the ~workspace/Analysis directory: odat500_milestone_two_data_firefighter.csv odat500_milestone_two_data_police.csv Modify Files: Utilize thecommand line interface to rename the filesto: o Firefighter.csv oPolice.csv • Code Comments: Utilize comments to add explanations toyour code to make it more readable. You will submit your Rscriptwhen it is complete. • Import Data to RStudio: Using an Rscript,create the commands needed to read in each of the data files sothat they can be further analyzed. Take a screenshot of the dataviewer in RStudio to confirm that you imported the data to RStudio.• Summary: Perform the summary function to get the descriptivestatistics from the file. Identify any noteworthy findings fromthis summary function and whether or not this changes your planfrom Milestone One. Be sure to explain your rationale in eithercase. You must also submit either a screenshot or an export of thelog of the execution of the command and its results. • Variables:Use the same two of the data fields (i.e., columns) in the filesthat you selected to compare in Milestone One. For example, we canuse Total Salary and Total Compensation fields in each file tocompare Firefighter and Police. For each of the Firefighter andPolice data, create three separate variables for each of the twofields selected. There will be a total of 12 variables created. Thethree separate variables will be the minimum, maximum, and averagevalue for each of the data fields for each of the Firefighter andPolice data files. • Data Validation: Discuss your findings. Youhave now calculated the same information (the min, max, andaverage) in three different ways and places (Milestone One, thesummary function, and the variables function). Do the calculationsand commands you performed above confirm what you found inMilestone One? Why or why not? This is considered data validation.Did you find new avenues to pursue? • Data Discovery: Now, assumingyou have validated your data, compare the variables fromFirefighter and Police. How do the numbers compare, and what mightit mean? Consider explaining in a few sentences how you might wantto proceed to dig deeper into the data to come to an informedconclusion.
This is the code that I wrote, however, I don't believe that I'mcompleting it correctly.
Min(firefighter[["total Compensation"]])
minfirecomp<- min(firefighter[["firefighter"]])
max(fire[["total Compensation"]])
maxfirecomp <- max(firefighter[["firefighter"]])
mean(firefighter[[“total compensation”]])
avg(firefighter[[“total compensation”]])
avgfirecomp <-mean(firefighter[["firefighter"]])
min(firefighter[["total benefits"]])
minfirebene <-min(firefighter[["total benefits"]])
max(firefighter[["total benefits"]])
maxfirebene <-max(firefighter[["total benefits"]])
mean(firefighter[[“total benefits”]])
avgfirebene <- mean(firefighter[[“total benefits”]])
1 2 Employee Job Identifier 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 Filter 18 4053 Firefighter 39839 Firefighter 26574 Firefighter Salaries 35177 Firefighter 5580 Firefighter 42143 Firefighter 20724 Firefighter 18961 Firefighter 14624 Firefighter Overtime 77396,30 117156.20 119258.61 118184.79 47016.00 114949.65 119258.67 107397.47 119258.64 8292441 69330.70 111361.39 119250.06 7002657 84419.58 81140.09 110104.79 7200.00 14942 Firefighter 25402 Firefighter 41240 Firefighter 23234 Firefighter 36619 Firefighter 2004 Firefighter 16709 Firefighter 32882 Firefighter 15609 Firefighter Other Salaries 18640.82 5409.35 101446.47 11444.87 15389.51 143990.58 11123.19 16981.56 147363.36 5902.13 0.00 425.30 5229.61 31247.65 3448.91 20321.97 4229.76 Total Salary 33295.23 24624.39 5631.28 25195.54 23507.03 67233.68 0.00 21033.72 145120.64 51015.78 3999.78 20926.86 136301.81 19705.20 144193.48 12817.11 151462:23 15762.83 138470.38 6698.06 10994444 4003.91 77564.37 1111403 155770.65 2544239 169346.84 Retirement 447146 8012931 9306.90 118922.02 9241.69 113809.61 20005 34 205501.83 0.00 7200.00 14709.28 22842.08 23228.99 23443.14 8962.20 22685.00 23425.60 2001895 22774.35 15839.71 13128.33 20602.51 23425.05 1326625 1650744 15921.70 2321237 1278.00 Health/Dental 15742.33 16680.76 16977.02 1682268 4630.10 16366.80 16977.02 14656 19 16977.02 16822.68 14096.07 15843.74 1697702 1425041 16422.68 16977.01 120614 Other Benefits Total Benefits 1694.41 32145.02 2444.69 41967.53 1660.43 41866.44 2415.90 873.55 217723 2374.00 2591.11 2369.49 1843.56 290001 2615.58 2049.03 3052.02 1995.16 42681.72 14465.85 41229.03 42776.62 38066.25 42120.86 30125.21 39061.83 43251.10 30568.68 35325.28 105952 3475823 345104 43400099 1584) a Total Compensation 133592.49 185958.11 189229.80 187802.36 65481.63 177530.84 186970 10 18952848 180591.24 144450.39 107689.58 19401245 21259754 154247.30 14564784 240915 1032297 Fid 000
1 2 Employee Identifier 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 Filter Job Salaries 32579 Police Officer 40986 Police Officer 55037 Police Officer 34253 Police Officer 2406 Police Officer 9937 Police Officer 13835 Police Officer Console 37789 Police Officer 37205 Police Officer 11975 Police Officer 33738 Police Officer 39657 Police Officer 30619 Police Officer, 13743 Police Officer 4611 Police Officer 50469 Police Officer 13298 Police Officer 19 Showing 1 to 20 of 009 entries 626.00 105748.50 75945.33 15800.00 85329.05 85329.11 110811.47 75945.32 60184.14 86569.08 60295.31 85336.95 11175.50 11831403 15800.00 60761.07 89762.39 27763 Police Officer 958 Police Officer Overtime 15000.00 66555.31 Other Salaries 0:00 28059.73 1857.18 9496.97 3961.53 6397.95 8820.79 3216.70 1028.61 11986.44 1340.81 9834.20 0.00 28204.36 6938.73 1961.95 13367.29 4585.71 1857.19 Total Salary 0.00 626.00 3293.65 137101.88 2125.34 79927.85 3097.93 28394.90 5679.09 94969.67 5189.75 96916.81 9467.59 129099.85 2110.38 8127240 6723.86 67936.61 6423.90 104979.50 690.99 62327.11 8383.43 103554.58 0.00 11175.50 10600.35 157118.74 3340.50 2607923 1279.69 72002.71 11334.19 114403.87 1607.42 2199313 70308.35 Retirement 113.49 19636.20 13717.25 2963.84 15689.33 1577245 20568.18 1371724 10957.79 16104.94 10003.20 15760.88 1983.66 20007.06 2963.04 12407.56 16697.50 296334 11968.87 Health/Dental 13890.29 1600.59 Other Benefits 102.90 49.58 265.97 13890.30 2204.28 35730.78 12346.92 4575.62 30639.79 2057.82 477.23 5498.09 13890.29 2741.88 32321.50 13890.28 2323.89 31956.62 13890.30 1843.21 36301.69 12346.92 4599.88 30664.04 9838.96 3392.05 24188.80 13890.27 1729.67 3172488 9774.65 4292.77 2487070 1303749 205782 11188.40 13090.20 205782 1000554 Total Benefits 2116.12 31767.29 862.59 4646.54 2635.92 4381.20 1069.53 37203.49 545906 20019.67 3245731 5390.70 27223.00 Total Compensation 891.97 172832.66 110567.64 33893.79 127291.17 120903.43 165401.54 111936.44 92125.41 13670438 135321.87 15822.34 19440223 115.39.09 100042.38 146941.18 2718383
This is the code that I wrote, however, I don't believe that I'mcompleting it correctly.
Min(firefighter[["total Compensation"]])
minfirecomp<- min(firefighter[["firefighter"]])
max(fire[["total Compensation"]])
maxfirecomp <- max(firefighter[["firefighter"]])
mean(firefighter[[“total compensation”]])
avg(firefighter[[“total compensation”]])
avgfirecomp <-mean(firefighter[["firefighter"]])
min(firefighter[["total benefits"]])
minfirebene <-min(firefighter[["total benefits"]])
max(firefighter[["total benefits"]])
maxfirebene <-max(firefighter[["total benefits"]])
mean(firefighter[[“total benefits”]])
avgfirebene <- mean(firefighter[[“total benefits”]])
1 2 Employee Job Identifier 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 Filter 18 4053 Firefighter 39839 Firefighter 26574 Firefighter Salaries 35177 Firefighter 5580 Firefighter 42143 Firefighter 20724 Firefighter 18961 Firefighter 14624 Firefighter Overtime 77396,30 117156.20 119258.61 118184.79 47016.00 114949.65 119258.67 107397.47 119258.64 8292441 69330.70 111361.39 119250.06 7002657 84419.58 81140.09 110104.79 7200.00 14942 Firefighter 25402 Firefighter 41240 Firefighter 23234 Firefighter 36619 Firefighter 2004 Firefighter 16709 Firefighter 32882 Firefighter 15609 Firefighter Other Salaries 18640.82 5409.35 101446.47 11444.87 15389.51 143990.58 11123.19 16981.56 147363.36 5902.13 0.00 425.30 5229.61 31247.65 3448.91 20321.97 4229.76 Total Salary 33295.23 24624.39 5631.28 25195.54 23507.03 67233.68 0.00 21033.72 145120.64 51015.78 3999.78 20926.86 136301.81 19705.20 144193.48 12817.11 151462:23 15762.83 138470.38 6698.06 10994444 4003.91 77564.37 1111403 155770.65 2544239 169346.84 Retirement 447146 8012931 9306.90 118922.02 9241.69 113809.61 20005 34 205501.83 0.00 7200.00 14709.28 22842.08 23228.99 23443.14 8962.20 22685.00 23425.60 2001895 22774.35 15839.71 13128.33 20602.51 23425.05 1326625 1650744 15921.70 2321237 1278.00 Health/Dental 15742.33 16680.76 16977.02 1682268 4630.10 16366.80 16977.02 14656 19 16977.02 16822.68 14096.07 15843.74 1697702 1425041 16422.68 16977.01 120614 Other Benefits Total Benefits 1694.41 32145.02 2444.69 41967.53 1660.43 41866.44 2415.90 873.55 217723 2374.00 2591.11 2369.49 1843.56 290001 2615.58 2049.03 3052.02 1995.16 42681.72 14465.85 41229.03 42776.62 38066.25 42120.86 30125.21 39061.83 43251.10 30568.68 35325.28 105952 3475823 345104 43400099 1584) a Total Compensation 133592.49 185958.11 189229.80 187802.36 65481.63 177530.84 186970 10 18952848 180591.24 144450.39 107689.58 19401245 21259754 154247.30 14564784 240915 1032297 Fid 000
1 2 Employee Identifier 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 Filter Job Salaries 32579 Police Officer 40986 Police Officer 55037 Police Officer 34253 Police Officer 2406 Police Officer 9937 Police Officer 13835 Police Officer Console 37789 Police Officer 37205 Police Officer 11975 Police Officer 33738 Police Officer 39657 Police Officer 30619 Police Officer, 13743 Police Officer 4611 Police Officer 50469 Police Officer 13298 Police Officer 19 Showing 1 to 20 of 009 entries 626.00 105748.50 75945.33 15800.00 85329.05 85329.11 110811.47 75945.32 60184.14 86569.08 60295.31 85336.95 11175.50 11831403 15800.00 60761.07 89762.39 27763 Police Officer 958 Police Officer Overtime 15000.00 66555.31 Other Salaries 0:00 28059.73 1857.18 9496.97 3961.53 6397.95 8820.79 3216.70 1028.61 11986.44 1340.81 9834.20 0.00 28204.36 6938.73 1961.95 13367.29 4585.71 1857.19 Total Salary 0.00 626.00 3293.65 137101.88 2125.34 79927.85 3097.93 28394.90 5679.09 94969.67 5189.75 96916.81 9467.59 129099.85 2110.38 8127240 6723.86 67936.61 6423.90 104979.50 690.99 62327.11 8383.43 103554.58 0.00 11175.50 10600.35 157118.74 3340.50 2607923 1279.69 72002.71 11334.19 114403.87 1607.42 2199313 70308.35 Retirement 113.49 19636.20 13717.25 2963.84 15689.33 1577245 20568.18 1371724 10957.79 16104.94 10003.20 15760.88 1983.66 20007.06 2963.04 12407.56 16697.50 296334 11968.87 Health/Dental 13890.29 1600.59 Other Benefits 102.90 49.58 265.97 13890.30 2204.28 35730.78 12346.92 4575.62 30639.79 2057.82 477.23 5498.09 13890.29 2741.88 32321.50 13890.28 2323.89 31956.62 13890.30 1843.21 36301.69 12346.92 4599.88 30664.04 9838.96 3392.05 24188.80 13890.27 1729.67 3172488 9774.65 4292.77 2487070 1303749 205782 11188.40 13090.20 205782 1000554 Total Benefits 2116.12 31767.29 862.59 4646.54 2635.92 4381.20 1069.53 37203.49 545906 20019.67 3245731 5390.70 27223.00 Total Compensation 891.97 172832.66 110567.64 33893.79 127291.17 120903.43 165401.54 111936.44 92125.41 13670438 135321.87 15822.34 19440223 115.39.09 100042.38 146941.18 2718383