First begin by reading in the data from the ‘marketing.csv’ file, and viewing it to make sure we see it being read in correctly.
mydata = read.csv(file="~/BSAD/rottentomatoes.csv")
head(mydata)
Now calculate the Range, Min, Max, Mean, STDEV, and Variance for each variable. Below is an example of how to compute the items for the variable ‘sales’. Follow the example and do the same for radio, paper, tv, and pos.
Sales
str(mydata)
'data.frame': 5043 obs. of 21 variables:
$ ï..title : Factor w/ 4917 levels "#Horror ",..: 398 2731 3279 3707 3332 1961 3289 3459 399 1631 ...
$ genres : Factor w/ 914 levels "Action","Action|Adventure",..: 107 101 128 288 754 126 120 308 126 447 ...
$ director : Factor w/ 2399 levels "","A. Raven Cruz",..: 929 801 2027 380 606 109 2030 1652 1228 554 ...
$ actor1 : Factor w/ 2098 levels "","50 Cent","A.J. Buckley",..: 305 983 355 1968 528 443 787 223 338 35 ...
$ actor2 : Factor w/ 3033 levels "","50 Cent","A. Michael Baldwin",..: 1408 2218 2489 534 2433 2549 1228 801 2440 653 ...
$ actor3 : Factor w/ 3522 levels "","50 Cent","A.J. Buckley",..: 3442 1393 3134 1771 1 2714 1970 2163 3018 2941 ...
$ length : int 178 169 148 164 NA 132 156 100 141 153 ...
$ budget : num 2.37e+08 3.00e+08 2.45e+08 2.50e+08 NA ...
$ director_fb_likes: int 0 563 0 22000 131 475 0 15 0 282 ...
$ actor1_fb_likes : int 1000 40000 11000 27000 131 640 24000 799 26000 25000 ...
$ actor2_fb_likes : int 936 5000 393 23000 12 632 11000 553 21000 11000 ...
$ actor3_fb_likes : int 855 1000 161 23000 NA 530 4000 284 19000 10000 ...
$ total_cast_likes : int 4834 48350 11700 106759 143 1873 46055 2036 92000 58753 ...
$ fb_likes : int 33000 0 85000 164000 0 24000 0 29000 118000 10000 ...
$ critic_reviews : int 723 302 602 813 NA 462 392 324 635 375 ...
$ users_reviews : int 3054 1238 994 2701 NA 738 1902 387 1117 973 ...
$ users_votes : int 886204 471220 275868 1144337 8 212204 383056 294810 462669 321795 ...
$ score : num 7.9 7.1 6.8 8.5 7.1 6.6 6.2 7.8 7.5 7.5 ...
$ aspect_ratio : num 1.78 2.35 2.35 2.35 NA 2.35 2.35 1.85 2.35 2.35 ...
$ gross : int 760505847 309404152 200074175 448130642 NA 73058679 336530303 200807262 458991599 301956980 ...
$ year : int 2009 2007 2015 2012 NA 2012 2007 2010 2015 2009 ...
Follow the example and do the same for radio, paper, tv, and pos. Use the worksheet given to try the different commands to find the max, min, and range.
summary(mydata)
ï..title genres
Ben-Hur : 3 Drama : 236
Halloween : 3 Comedy : 209
Home : 3 Comedy|Drama : 191
King Kong : 3 Comedy|Drama|Romance: 187
Pan : 3 Comedy|Romance : 158
The Fast and the Furious : 3 Drama|Romance : 152
(Other) :5025 (Other) :3910
director actor1
: 104 Robert De Niro : 49
Steven Spielberg: 26 Johnny Depp : 41
Woody Allen : 22 Nicolas Cage : 33
Clint Eastwood : 20 J.K. Simmons : 31
Martin Scorsese : 20 Bruce Willis : 30
Ridley Scott : 17 Denzel Washington: 30
(Other) :4834 (Other) :4829
actor2 actor3 length
Morgan Freeman : 20 : 23 Min. : 7.0
Charlize Theron: 15 Ben Mendelsohn: 8 1st Qu.: 93.0
Brad Pitt : 14 John Heard : 8 Median :103.0
: 13 Steve Coogan : 8 Mean :107.2
James Franco : 11 Anne Hathaway : 7 3rd Qu.:118.0
Meryl Streep : 11 Jon Gries : 7 Max. :511.0
(Other) :4959 (Other) :4982 NA's :15
budget director_fb_likes actor1_fb_likes
Min. :2.180e+02 Min. : 0.0 Min. : 0
1st Qu.:6.000e+06 1st Qu.: 7.0 1st Qu.: 614
Median :2.000e+07 Median : 49.0 Median : 988
Mean :3.975e+07 Mean : 686.5 Mean : 6560
3rd Qu.:4.500e+07 3rd Qu.: 194.5 3rd Qu.: 11000
Max. :1.222e+10 Max. :23000.0 Max. :640000
NA's :492 NA's :104 NA's :7
actor2_fb_likes actor3_fb_likes total_cast_likes fb_likes
Min. : 0 Min. : 0.0 Min. : 0 Min. : 0
1st Qu.: 281 1st Qu.: 133.0 1st Qu.: 1411 1st Qu.: 0
Median : 595 Median : 371.5 Median : 3090 Median : 166
Mean : 1652 Mean : 645.0 Mean : 9699 Mean : 7526
3rd Qu.: 918 3rd Qu.: 636.0 3rd Qu.: 13756 3rd Qu.: 3000
Max. :137000 Max. :23000.0 Max. :656730 Max. :349000
NA's :13 NA's :23
critic_reviews users_reviews users_votes score
Min. : 1.0 Min. : 1.0 Min. : 5 Min. :1.600
1st Qu.: 50.0 1st Qu.: 65.0 1st Qu.: 8594 1st Qu.:5.800
Median :110.0 Median : 156.0 Median : 34359 Median :6.600
Mean :140.2 Mean : 272.8 Mean : 83668 Mean :6.442
3rd Qu.:195.0 3rd Qu.: 326.0 3rd Qu.: 96309 3rd Qu.:7.200
Max. :813.0 Max. :5060.0 Max. :1689764 Max. :9.500
NA's :50 NA's :21
aspect_ratio gross year
Min. : 1.18 Min. : 162 Min. :1916
1st Qu.: 1.85 1st Qu.: 5340988 1st Qu.:1999
Median : 2.35 Median : 25517500 Median :2005
Mean : 2.22 Mean : 48468408 Mean :2002
3rd Qu.: 2.35 3rd Qu.: 62309438 3rd Qu.:2011
Max. :16.00 Max. :760505847 Max. :2016
NA's :329 NA's :884 NA's :108
gross = mydata$gross
gross
[1] 760505847 309404152 200074175 448130642 NA 73058679
[7] 336530303 200807262 458991599 301956980 330249062 200069408
[13] 168368427 423032628 89289910 291021565 141614023 623279547
[19] 241063875 179020854 255108370 262030663 105219735 258355354
[25] 70083519 218051260 658672302 407197282 65173160 652177271
[31] 304360277 373377893 408992272 334185206 234360014 268488329
[37] 402076689 245428137 234903076 202853933 172051787 191450875
[43] 116593191 414984497 125320003 350034110 202351611 233914986
[49] 228756232 65171860 144812796 90755643 101785482 352358779
[55] 317011114 123070338 237282182 130468626 223806889 140080850
[61] 166112167 137850096 47375327 124051759 291709845 154985087
[67] 533316061 292979556 198332128 318298180 73820094 113745408
[73] 102176165 161087183 100289690 100189501 88246220 150167630
[79] 356454367 362645141 312057433 155111815 241407328 208543795
[85] NA 38297305 259746958 238371987 93417865 222487711
[91] 189412677 665426 102315545 217387997 150350192 333130696
[97] 187991439 292568851 NA 303001229 144512310 127490802
[103] 146405371 281666058 63143812 60655503 76846624 320706665
[109] 46978995 89732035 104383624 198539855 318759914 34293771
[115] 292000866 289994397 227946274 256386216 206456431 206435493
[121] 205343774 179982968 177243721 179883016 139259759 400736600
[127] 281492479 206360018 153629485 133375846 181015141 114053579
[133] 119420252 83640426 79711678 195000874 61937495 124051759
[139] 126597121 165230261 131564731 133382309 73103784 21379315
[145] 64459316 34964818 111505642 133228348 216366733 160201106
[151] 118099659 201573391 190418803 82161969 143523463 209364921
[157] 103400692 110332737 111110575 65007045 257704099 403706375
[163] 176997107 31141074 31704416 107503316 129734803 132122995
[169] 122512052 68642452 32131830 176636816 126930660 93926386
[175] 292298923 63992328 134518390 NA 52792307 183635922
[181] 83024900 123207194 83348920 227137090 215395021 180191634
[187] 424645577 292298923 177343675 234277056 138396624 149234747
[193] 118311368 101160529 77564037 249358727 49551662 60522097
[199] 137748063 NA 113733726 148337537 317557891 33592415
[205] NA 305388685 NA 337103873 217536138 131536019
[211] 214948780 209805005 186830669 163192114 119412921 32694788
[217] 113165635 107285004 260031035 186739919 215397307 182618434
[223] 131920333 124976634 115802596 108521835 100685880 126464904
[229] 64736114 93050117 57637485 58607007 43929341 30212620
[235] 76418654 89021735 380262555 310675583 289907418 132550960
[241] 474544677 187165546 NA 40911830 47952020 190871240
[247] 274084951 67155742 81638674 56114221 250863268 155181732
[253] 125332007 113330342 125531634 186336103 129995817 102608827
[259] 42776259 98780042 NA 106369117 142614158 50026353
[265] 66002193 85463309 71017784 48068396 61656849 134520804
[271] 313837577 24004159 58183966 100446895 144795350 47396698
[277] 140015224 104374107 228430993 NA 35799026 6712451
[283] 101643008 187670866 132014112 261970615 167007184 180011740
[289] 204843350 97030725 130127620 146282411 65452312 148383780
[295] 119219978 101228120 162804648 100117603 89296573 85017401
[301] 173005002 75030163 77222184 34964818 107515297 67631157
[307] 66862068 57366262 116866727 184031112 54700065 27098580
[313] 55673333 40198710 72660029 38120554 49392095 39292022
[319] 28772222 17010646 24985612 4411102 35024475 130174897
[325] 10200000 202007640 77679638 9213 58867694 59475623
[331] 108638745 86897182 63540020 95328937 50802661 161317423
[337] 201148159 43982842 380838870 377019252 340478898 17176900
[343] 131144183 23014504 181166115 176740650 71148699 67344392
[349] 22406362 261437578 11000000 88761720 250147615 245823397
[355] 81557479 226138454 155370362 124870275 196573705 58229120
[361] 125305545 132373442 120618403 110416702 102515793 100012500
[367] 209019489 NA 84037039 85884815 83077470 100018837
[373] 78747585 78616689 75817994 100853835 73209340 72515360
[379] 68558662 65653758 64685359 61355436 26871 60874615
[385] 143618384 58220776 47474112 42877165 35168677 56114221
[391] 37567440 61644321 190562 120147445 241688385 144512310
[397] 233630478 197992827 176049130 172620724 183405771 20315324
[403] 148313048 127706877 NA 126149655 66941559 78009155
[409] 63224849 111544445 112703470 117144465 84303558 150832203
[415] 51396781 47592825 50016394 57010853 62494975 46440491
[421] 44606335 40048332 NA 64933670 31494270 31111260
[427] 123307945 153288182 13401683 137340146 NA 43575716
[433] 80170146 75754670 33048353 34543701 242589580 102981571
[439] 180965237 407999255 254455986 162831698 155019340 145771527
[445] 82506325 140459099 53215979 158115031 133103929 133668525
[451] 130313314 124590960 127968405 120136047 128200012 112225777
[457] 109993847 104054514 103028109 NA 101087161 101111837
[463] 95632614 94822707 92969824 91188905 90443603 82226474
[469] 79363785 76081498 85707116 74329966 100169068 73215310
[475] 80360866 69102910 65948711 821997 169692572 NA
[481] 60507228 56684819 50628009 69772969 45356386 55350897
[487] 39442871 37899638 37754208 NA 27779888 38542418
[493] 34566746 32885565 36073232 21471685 20950820 19673424
[499] 19480739 17593391 18318000 27356090 17473245 15131330
[505] 19406406 1891821 23219748 NA 170708996 422783777
[511] 103812241 119793567 92930005 67286731 74158157 127083765
[517] 1339152 15071514 26000610 323505540 66462600 368049635
[523] 306124059 229074524 193136719 35286428 157299717 134568845
[529] 134006721 195329763 120776832 118823091 41814863 97360069
[535] 117698894 162001186 77032279 NA 73023275 68473360
[541] 66636385 160762022 103338338 NA 55808744 47379090
[547] 43426961 47000485 45434443 42044321 73661010 41523271
[553] 37600435 39251128 83503161 34636443 22751979 30013346
[559] 14567883 90820 5409517 21009180 94999143 336029560
[565] 36381716 55585389 36976367 107225164 70224196 51814190
[571] 47456450 148213377 112950721 75600000 62647540 183132370
[577] 27796042 32616869 18947630 114195633 144156464 227965690
[583] 436471036 244052771 152149590 141204016 162495848 136448821
[589] 120523073 119654900 72660029 117541000 116643346 NA
[595] 100614858 42272747 80281096 219613391 78120196 98895417
[601] 70117571 83552429 66257002 65012000 79883359 78031620
[607] 54222000 52474616 55942830 40932372 38345403 37901509
[613] 48430355 30157016 28031250 33105600 62321039 38509342
[619] 19076815 25093607 18990542 14294842 19819494 13596911
[625] 8460990 7097125 37760080 5851188 25121291 18821279
[631] 118471320 300523113 71069884 251501645 35324232 81257500
[637] 617840 29655590 45045037 28965197 27550735 39380442
[643] 72980108 37516013 87704396 NA 83892374 5932060
[649] 216119491 43568507 182805123 176387405 33685268 182204440
[655] 171383253 172071312 119412921 139225854 148775460 115731542
[661] 100468793 93771072 100448498 115603980 90454043 84049211
[667] 70450000 69688384 70236496 63695760 59617068 55637680
[673] 85911262 53846915 54758461 52397389 NA 38966057
[679] 42345531 36064910 33328051 32598931 28045540 37023395
[685] 43532294 NA 17218080 10014234 19059018 1987287
[691] 24407944 13750556 31054924 43247140 2208939 213079163
[697] 19548064 356784000 25052000 122012710 72413 58255287
[703] 77086030 65000000 32178777 15738632 54116191 118153533
[709] 108012170 210592590 279167575 143151473 136801374 168213584
[715] 135381507 167735396 121468960 106635996 102678089 125603360
[721] 101217900 104148781 75573300 93375151 106126012 93307796
[727] 90646554 109176215 82670733 82569532 81687587 80574010
[733] 75764085 90356857 75530832 75370763 100003492 90341670
[739] 74540762 80033643 73648142 71844424 75638743 66734992
[745] 75280058 64505912 77862546 61112916 88200225 60573641
[751] 59035104 56702901 55994557 54910560 53789313 51045801
[757] 50818750 NA 50189179 50024083 50549107 56443482
[763] 62401264 47748610 46975183 50807639 46611204 257756197
[769] 48472213 43060566 45996718 43337279 37479778 36965395
[775] 40559930 36830057 36279230 42194060 43119879 35096190
[781] 35754555 43290977 33927476 32122249 40076438 32940507
[787] 31670931 30695227 32522352 28424210 26082914 29136626
[793] 26288320 26616590 623279547 30063805 22518325 13082288
[799] 18208078 14218868 22451 31165421 11802056 25472967
[805] 22362500 17281832 19781879 7605668 4535117 4426297
[811] NA 10166502 363024263 12065985 350123553 80021740
[817] NA 48291624 35231365 53715611 31199215 NA
[823] 29580087 44665963 60128566 49875589 NA 60984028
[829] 36931089 51317350 28328132 51774002 25528495 NA
[835] 113006880 45860039 329691196 217326336 166225040 141600000
[841] 134218018 128769345 177575142 105263257 104354205 107100855
[847] 98711404 100328194 101530738 93815117 91400000 162586036
[853] 89706988 83000000 78745923 70098138 66365290 NA
[859] 66207920 63408614 58422650 56932305 68750000 68218041
[865] 25040293 55747724 55473600 49994804 41609593 38553833
[871] 76137505 34350553 34238611 34098563 33828318 33472850
[877] 31051126 35707327 20550712 18573791 51225796 16264475
[883] 25857987 12870569 11466088 16088610 51178893 6768055
[889] 39440655 6167817 NA NA 81645152 69951824
[895] 9483821 66676062 26838389 75604320 108200000 5660084
[901] 7221458 70327868 58297830 57386369 45207112 62563543
[907] 33574332 73343413 25031037 22843047 5755286 164435221
[913] 95720716 118683135 143704210 110476776 80270227 36385763
[919] 37035845 34580635 42438300 23324666 23020488 90567722
[925] 72601713 35092918 296623634 267652016 62453315 165500000
[931] 153620822 218628680 147637474 135014968 2175312 126203320
[937] 126975169 125548685 105807520 191616238 105264608 97680195
[943] 126088877 91030827 150315155 127997349 88504640 81517441
[949] 81022333 75621915 79948113 88658172 75888270 84244877
[955] 75367693 73701902 75605492 67823573 91439400 67128202
[961] 70496802 60470220 NA 58336565 66002004 54997476
[967] 55682070 52752475 55092830 50815288 52822418 50150619
[973] 48745150 50007168 48154732 48265581 46982632 44737059
[979] 56724080 44484065 47553512 42610000 41482207 47105085
[985] 41256277 50740078 40203020 40905277 38590500 39177541
[991] 39778599 37486138 38105077 35168395 NA 32800000
[997] 33643461 32741596 31874869 30306268
[ reached getOption("max.print") -- omitted 4043 entries ]
gross = gross[!is.na(gross)]
gross
[1] 760505847 309404152 200074175 448130642 73058679 336530303
[7] 200807262 458991599 301956980 330249062 200069408 168368427
[13] 423032628 89289910 291021565 141614023 623279547 241063875
[19] 179020854 255108370 262030663 105219735 258355354 70083519
[25] 218051260 658672302 407197282 65173160 652177271 304360277
[31] 373377893 408992272 334185206 234360014 268488329 402076689
[37] 245428137 234903076 202853933 172051787 191450875 116593191
[43] 414984497 125320003 350034110 202351611 233914986 228756232
[49] 65171860 144812796 90755643 101785482 352358779 317011114
[55] 123070338 237282182 130468626 223806889 140080850 166112167
[61] 137850096 47375327 124051759 291709845 154985087 533316061
[67] 292979556 198332128 318298180 73820094 113745408 102176165
[73] 161087183 100289690 100189501 88246220 150167630 356454367
[79] 362645141 312057433 155111815 241407328 208543795 38297305
[85] 259746958 238371987 93417865 222487711 189412677 665426
[91] 102315545 217387997 150350192 333130696 187991439 292568851
[97] 303001229 144512310 127490802 146405371 281666058 63143812
[103] 60655503 76846624 320706665 46978995 89732035 104383624
[109] 198539855 318759914 34293771 292000866 289994397 227946274
[115] 256386216 206456431 206435493 205343774 179982968 177243721
[121] 179883016 139259759 400736600 281492479 206360018 153629485
[127] 133375846 181015141 114053579 119420252 83640426 79711678
[133] 195000874 61937495 124051759 126597121 165230261 131564731
[139] 133382309 73103784 21379315 64459316 34964818 111505642
[145] 133228348 216366733 160201106 118099659 201573391 190418803
[151] 82161969 143523463 209364921 103400692 110332737 111110575
[157] 65007045 257704099 403706375 176997107 31141074 31704416
[163] 107503316 129734803 132122995 122512052 68642452 32131830
[169] 176636816 126930660 93926386 292298923 63992328 134518390
[175] 52792307 183635922 83024900 123207194 83348920 227137090
[181] 215395021 180191634 424645577 292298923 177343675 234277056
[187] 138396624 149234747 118311368 101160529 77564037 249358727
[193] 49551662 60522097 137748063 113733726 148337537 317557891
[199] 33592415 305388685 337103873 217536138 131536019 214948780
[205] 209805005 186830669 163192114 119412921 32694788 113165635
[211] 107285004 260031035 186739919 215397307 182618434 131920333
[217] 124976634 115802596 108521835 100685880 126464904 64736114
[223] 93050117 57637485 58607007 43929341 30212620 76418654
[229] 89021735 380262555 310675583 289907418 132550960 474544677
[235] 187165546 40911830 47952020 190871240 274084951 67155742
[241] 81638674 56114221 250863268 155181732 125332007 113330342
[247] 125531634 186336103 129995817 102608827 42776259 98780042
[253] 106369117 142614158 50026353 66002193 85463309 71017784
[259] 48068396 61656849 134520804 313837577 24004159 58183966
[265] 100446895 144795350 47396698 140015224 104374107 228430993
[271] 35799026 6712451 101643008 187670866 132014112 261970615
[277] 167007184 180011740 204843350 97030725 130127620 146282411
[283] 65452312 148383780 119219978 101228120 162804648 100117603
[289] 89296573 85017401 173005002 75030163 77222184 34964818
[295] 107515297 67631157 66862068 57366262 116866727 184031112
[301] 54700065 27098580 55673333 40198710 72660029 38120554
[307] 49392095 39292022 28772222 17010646 24985612 4411102
[313] 35024475 130174897 10200000 202007640 77679638 9213
[319] 58867694 59475623 108638745 86897182 63540020 95328937
[325] 50802661 161317423 201148159 43982842 380838870 377019252
[331] 340478898 17176900 131144183 23014504 181166115 176740650
[337] 71148699 67344392 22406362 261437578 11000000 88761720
[343] 250147615 245823397 81557479 226138454 155370362 124870275
[349] 196573705 58229120 125305545 132373442 120618403 110416702
[355] 102515793 100012500 209019489 84037039 85884815 83077470
[361] 100018837 78747585 78616689 75817994 100853835 73209340
[367] 72515360 68558662 65653758 64685359 61355436 26871
[373] 60874615 143618384 58220776 47474112 42877165 35168677
[379] 56114221 37567440 61644321 190562 120147445 241688385
[385] 144512310 233630478 197992827 176049130 172620724 183405771
[391] 20315324 148313048 127706877 126149655 66941559 78009155
[397] 63224849 111544445 112703470 117144465 84303558 150832203
[403] 51396781 47592825 50016394 57010853 62494975 46440491
[409] 44606335 40048332 64933670 31494270 31111260 123307945
[415] 153288182 13401683 137340146 43575716 80170146 75754670
[421] 33048353 34543701 242589580 102981571 180965237 407999255
[427] 254455986 162831698 155019340 145771527 82506325 140459099
[433] 53215979 158115031 133103929 133668525 130313314 124590960
[439] 127968405 120136047 128200012 112225777 109993847 104054514
[445] 103028109 101087161 101111837 95632614 94822707 92969824
[451] 91188905 90443603 82226474 79363785 76081498 85707116
[457] 74329966 100169068 73215310 80360866 69102910 65948711
[463] 821997 169692572 60507228 56684819 50628009 69772969
[469] 45356386 55350897 39442871 37899638 37754208 27779888
[475] 38542418 34566746 32885565 36073232 21471685 20950820
[481] 19673424 19480739 17593391 18318000 27356090 17473245
[487] 15131330 19406406 1891821 23219748 170708996 422783777
[493] 103812241 119793567 92930005 67286731 74158157 127083765
[499] 1339152 15071514 26000610 323505540 66462600 368049635
[505] 306124059 229074524 193136719 35286428 157299717 134568845
[511] 134006721 195329763 120776832 118823091 41814863 97360069
[517] 117698894 162001186 77032279 73023275 68473360 66636385
[523] 160762022 103338338 55808744 47379090 43426961 47000485
[529] 45434443 42044321 73661010 41523271 37600435 39251128
[535] 83503161 34636443 22751979 30013346 14567883 90820
[541] 5409517 21009180 94999143 336029560 36381716 55585389
[547] 36976367 107225164 70224196 51814190 47456450 148213377
[553] 112950721 75600000 62647540 183132370 27796042 32616869
[559] 18947630 114195633 144156464 227965690 436471036 244052771
[565] 152149590 141204016 162495848 136448821 120523073 119654900
[571] 72660029 117541000 116643346 100614858 42272747 80281096
[577] 219613391 78120196 98895417 70117571 83552429 66257002
[583] 65012000 79883359 78031620 54222000 52474616 55942830
[589] 40932372 38345403 37901509 48430355 30157016 28031250
[595] 33105600 62321039 38509342 19076815 25093607 18990542
[601] 14294842 19819494 13596911 8460990 7097125 37760080
[607] 5851188 25121291 18821279 118471320 300523113 71069884
[613] 251501645 35324232 81257500 617840 29655590 45045037
[619] 28965197 27550735 39380442 72980108 37516013 87704396
[625] 83892374 5932060 216119491 43568507 182805123 176387405
[631] 33685268 182204440 171383253 172071312 119412921 139225854
[637] 148775460 115731542 100468793 93771072 100448498 115603980
[643] 90454043 84049211 70450000 69688384 70236496 63695760
[649] 59617068 55637680 85911262 53846915 54758461 52397389
[655] 38966057 42345531 36064910 33328051 32598931 28045540
[661] 37023395 43532294 17218080 10014234 19059018 1987287
[667] 24407944 13750556 31054924 43247140 2208939 213079163
[673] 19548064 356784000 25052000 122012710 72413 58255287
[679] 77086030 65000000 32178777 15738632 54116191 118153533
[685] 108012170 210592590 279167575 143151473 136801374 168213584
[691] 135381507 167735396 121468960 106635996 102678089 125603360
[697] 101217900 104148781 75573300 93375151 106126012 93307796
[703] 90646554 109176215 82670733 82569532 81687587 80574010
[709] 75764085 90356857 75530832 75370763 100003492 90341670
[715] 74540762 80033643 73648142 71844424 75638743 66734992
[721] 75280058 64505912 77862546 61112916 88200225 60573641
[727] 59035104 56702901 55994557 54910560 53789313 51045801
[733] 50818750 50189179 50024083 50549107 56443482 62401264
[739] 47748610 46975183 50807639 46611204 257756197 48472213
[745] 43060566 45996718 43337279 37479778 36965395 40559930
[751] 36830057 36279230 42194060 43119879 35096190 35754555
[757] 43290977 33927476 32122249 40076438 32940507 31670931
[763] 30695227 32522352 28424210 26082914 29136626 26288320
[769] 26616590 623279547 30063805 22518325 13082288 18208078
[775] 14218868 22451 31165421 11802056 25472967 22362500
[781] 17281832 19781879 7605668 4535117 4426297 10166502
[787] 363024263 12065985 350123553 80021740 48291624 35231365
[793] 53715611 31199215 29580087 44665963 60128566 49875589
[799] 60984028 36931089 51317350 28328132 51774002 25528495
[805] 113006880 45860039 329691196 217326336 166225040 141600000
[811] 134218018 128769345 177575142 105263257 104354205 107100855
[817] 98711404 100328194 101530738 93815117 91400000 162586036
[823] 89706988 83000000 78745923 70098138 66365290 66207920
[829] 63408614 58422650 56932305 68750000 68218041 25040293
[835] 55747724 55473600 49994804 41609593 38553833 76137505
[841] 34350553 34238611 34098563 33828318 33472850 31051126
[847] 35707327 20550712 18573791 51225796 16264475 25857987
[853] 12870569 11466088 16088610 51178893 6768055 39440655
[859] 6167817 81645152 69951824 9483821 66676062 26838389
[865] 75604320 108200000 5660084 7221458 70327868 58297830
[871] 57386369 45207112 62563543 33574332 73343413 25031037
[877] 22843047 5755286 164435221 95720716 118683135 143704210
[883] 110476776 80270227 36385763 37035845 34580635 42438300
[889] 23324666 23020488 90567722 72601713 35092918 296623634
[895] 267652016 62453315 165500000 153620822 218628680 147637474
[901] 135014968 2175312 126203320 126975169 125548685 105807520
[907] 191616238 105264608 97680195 126088877 91030827 150315155
[913] 127997349 88504640 81517441 81022333 75621915 79948113
[919] 88658172 75888270 84244877 75367693 73701902 75605492
[925] 67823573 91439400 67128202 70496802 60470220 58336565
[931] 66002004 54997476 55682070 52752475 55092830 50815288
[937] 52822418 50150619 48745150 50007168 48154732 48265581
[943] 46982632 44737059 56724080 44484065 47553512 42610000
[949] 41482207 47105085 41256277 50740078 40203020 40905277
[955] 38590500 39177541 39778599 37486138 38105077 35168395
[961] 32800000 33643461 32741596 31874869 30306268 27667947
[967] 27067160 26616999 26536120 26199517 25450527 25407250
[973] 23159305 24006726 20389967 19593740 19118247 26442251
[979] 17114882 18472363 14131298 21557240 21283440 10556196
[985] 16671505 10400000 9528092 10137232 9795017 20488579
[991] 19445217 8355815 28837115 6471394 6291602 10706786
[997] 8742261 43905746 21413502 7994115
[ reached getOption("max.print") -- omitted 3159 entries ]
max_gross=max(gross)
max_gross
[1] 760505847
min_gross=min(gross)
min_gross
[1] 162
max_gross-min_gross
[1] 760505685
mean_gross=mean(gross,na.rm = TRUE)
sd(gross,na.rm = TRUE)
[1] 68452990
var(gross,na.rm = TRUE)
[1] 4.685812e+15
An easy way to calculate all of these statistics of all of these variables is with the summary function. Below is an example.
summary(mydata)
ï..title genres
Ben-Hur : 3 Drama : 236
Halloween : 3 Comedy : 209
Home : 3 Comedy|Drama : 191
King Kong : 3 Comedy|Drama|Romance: 187
Pan : 3 Comedy|Romance : 158
The Fast and the Furious : 3 Drama|Romance : 152
(Other) :5025 (Other) :3910
director actor1
: 104 Robert De Niro : 49
Steven Spielberg: 26 Johnny Depp : 41
Woody Allen : 22 Nicolas Cage : 33
Clint Eastwood : 20 J.K. Simmons : 31
Martin Scorsese : 20 Bruce Willis : 30
Ridley Scott : 17 Denzel Washington: 30
(Other) :4834 (Other) :4829
actor2 actor3 length
Morgan Freeman : 20 : 23 Min. : 7.0
Charlize Theron: 15 Ben Mendelsohn: 8 1st Qu.: 93.0
Brad Pitt : 14 John Heard : 8 Median :103.0
: 13 Steve Coogan : 8 Mean :107.2
James Franco : 11 Anne Hathaway : 7 3rd Qu.:118.0
Meryl Streep : 11 Jon Gries : 7 Max. :511.0
(Other) :4959 (Other) :4982 NA's :15
budget director_fb_likes actor1_fb_likes
Min. :2.180e+02 Min. : 0.0 Min. : 0
1st Qu.:6.000e+06 1st Qu.: 7.0 1st Qu.: 614
Median :2.000e+07 Median : 49.0 Median : 988
Mean :3.975e+07 Mean : 686.5 Mean : 6560
3rd Qu.:4.500e+07 3rd Qu.: 194.5 3rd Qu.: 11000
Max. :1.222e+10 Max. :23000.0 Max. :640000
NA's :492 NA's :104 NA's :7
actor2_fb_likes actor3_fb_likes total_cast_likes fb_likes
Min. : 0 Min. : 0.0 Min. : 0 Min. : 0
1st Qu.: 281 1st Qu.: 133.0 1st Qu.: 1411 1st Qu.: 0
Median : 595 Median : 371.5 Median : 3090 Median : 166
Mean : 1652 Mean : 645.0 Mean : 9699 Mean : 7526
3rd Qu.: 918 3rd Qu.: 636.0 3rd Qu.: 13756 3rd Qu.: 3000
Max. :137000 Max. :23000.0 Max. :656730 Max. :349000
NA's :13 NA's :23
critic_reviews users_reviews users_votes score
Min. : 1.0 Min. : 1.0 Min. : 5 Min. :1.600
1st Qu.: 50.0 1st Qu.: 65.0 1st Qu.: 8594 1st Qu.:5.800
Median :110.0 Median : 156.0 Median : 34359 Median :6.600
Mean :140.2 Mean : 272.8 Mean : 83668 Mean :6.442
3rd Qu.:195.0 3rd Qu.: 326.0 3rd Qu.: 96309 3rd Qu.:7.200
Max. :813.0 Max. :5060.0 Max. :1689764 Max. :9.500
NA's :50 NA's :21
aspect_ratio gross year
Min. : 1.18 Min. : 162 Min. :1916
1st Qu.: 1.85 1st Qu.: 5340988 1st Qu.:1999
Median : 2.35 Median : 25517500 Median :2005
Mean : 2.22 Mean : 48468408 Mean :2002
3rd Qu.: 2.35 3rd Qu.: 62309438 3rd Qu.:2011
Max. :16.00 Max. :760505847 Max. :2016
NA's :329 NA's :884 NA's :108
There are some statistics not captured here like standard deviation and variance, but there is an easy and quick way to find most of your basic statistics.
Now, we will produce a basic blot of the ‘sales’ variable . Here we utilize the plot function and within the plot function we call the variable we want to plot.
plot(order(gross,decreasing = TRUE))
When looking at this graph we cannot truly capture the data or see a clear pattern. A better way to visualize this plot would be to re-order the data based on increasing sales.
us_vot=mydata$users_votes
tot_c_lik=mydata$total_cast_likes
dir_fb_lik=mydata$director_fb_likes
crit_rev=mydata$critic_reviews
plot(us_vot, type = "b", xlab = "Case Number", ylab = "User votes in 1,000")
There are further ways to customize plots, such as changing the colors of the lines, adding a heading, or even making them interactive.
Now, lets plot the sales graph, alongside radio, paper, and tv which you will code. Make sure to run the code in the same chunk so they are on the same layout.
likes01 = mydata$actor1_fb_likes
likes02 = mydata$actor2_fb_likes
likes03 = mydata$actor3_fb_likes
likes04 = mydata$director_fb_likes
layout(matrix(1:4,2,2))
plot(us_vot, type="b", xlab = "total", ylab = "votes in 1,000")
plot(tot_c_lik, type="b", xlab = "cast", ylab = "likes in 1,000")
plot(dir_fb_lik, type="b", xlab = "director", ylab = "fb likes in 1,000")
plot(crit_rev, type="b", xlab = "cridic", ylab = "revies in 1,000")
The 20 months of case_number are in no particular order and not related to a chronological time sequence. They are simply 20 independent use case studies. Since each case is independent, we can reorder them. To reveal a potential trend, consider reordering the sales column from low to high and see how the other four variables behave.
year = mydata$year
newdata = mydata[order(year,decreasing = TRUE),]
new_gross = newdata$gross
new_likes1 = newdata$actor1_fb_likes
new_likes2 = newdata$actor2_fb_likes
new_likes3 = newdata$actor3_fb_likes
new_likes4 = newdata$director_fb_likes
plot(new_gross)
gross_me = mean(gross)
gross_me
[1] 48468408
gross_s=sd(gross)
gross_s
[1] 68452990
zscore=(gross-gross_me)/gross_s
zscore
[1] 10.4018456303 3.8118969354 2.2147427965 5.8384919623
[5] 0.3592285935 4.2081710912 2.2254521460 5.9971549649
[9] 3.7031044349 4.1164111702 2.2146731575 1.7515672976
[13] 5.4718459789 0.5963435960 3.5433537077 1.3607238322
[17] 8.3971662273 2.8135435171 1.9071839760 3.0187134433
[21] 3.1198382146 0.8290554892 3.0661472220 0.3157657735
[25] 2.4773622217 8.9142036098 5.2405142883 0.2440324720
[29] 8.8193205235 3.7382131567 4.7464615262 5.2667365175
[33] 4.1739125879 2.7156097240 3.2141754518 5.1657097697
[37] 2.8772991247 2.7235430809 2.2553510735 1.8053759037
[41] 2.0887687529 0.9952053670 5.3542743293 1.1226915724
[45] 4.4054423414 2.2480128697 2.7091085033 2.6337465072
[49] 0.2440134809 1.4074533173 0.6177558526 0.7788859790
[53] 4.4394024209 3.9230237387 1.0898271937 2.7582984069
[57] 1.1979055692 2.5614437054 1.3383263739 1.7186065754
[61] 1.3057382577 -0.0159683386 1.1041643468 3.5534084912
[65] 1.5560558975 7.0829287423 3.5719571476 2.1892939887
[69] 3.9418259267 0.3703517744 0.9536033423 0.7845932972
[73] 1.6451987671 0.7570346035 0.7555709859 0.5810967822
[77] 1.4856797610 4.4992330868 4.5896714148 3.8506575649
[81] 1.5579072118 2.8185608727 2.3384717957 -0.1485852183
[85] 3.0864765603 2.7742188947 0.6566470973 2.5421724070
[89] 2.0589936038 -0.6983329906 0.7866294391 2.4676729006
[93] 1.4883467299 4.1585077094 2.0382313553 3.5659573367
[97] 3.7183594149 1.4030636479 1.1544038320 1.4307185536
[101] 3.4066831701 0.2143866087 0.1780359835 0.4145650364
[105] 3.9770104378 -0.0217581806 0.6028024080 0.8168411068
[109] 2.1923285822 3.9485711981 -0.2070711073 3.5576598906
[113] 3.5283482566 2.6219141826 3.0373809404 2.3079784018
[117] 2.3076725277 2.2917240791 1.9212390815 1.8812226120
[121] 1.9197789261 1.3263314121 5.1461329916 3.4041474299
[125] 2.3065699462 1.5362524968 1.2403758832 1.9363176484
[129] 0.9581052786 1.0365046730 0.5138127385 0.4564193657
[133] 2.1406291461 0.1967640477 1.1041643468 1.1413484345
[137] 1.7057231938 1.2139180909 1.2404702984 0.3598875128
[141] -0.3957327847 0.2336042351 -0.1972680732 0.9208835738
[145] 1.2382211490 2.4527536985 1.6322544531 1.0172127036
[149] 2.2366441918 2.0736916614 0.4922146024 1.3886180116
[153] 2.3504672687 0.8024818802 0.9037491142 0.9151122116
[157] 0.2416057701 3.0566333206 5.1895171445 1.8776199352
[161] -0.2531274882 -0.2448978696 0.8624153320 1.1871854678
[165] 1.2220735272 1.0816714361 0.2947138517 -0.2386539642
[169] 1.8723566005 1.1462209608 0.6640758597 3.5620140758
[173] 0.2267822103 1.2570668122 0.0631659690 1.9746034995
[177] 0.5048207865 1.0918264636 0.5095542539 2.6100931651
[181] 2.4385583800 1.9242873924 5.4954088501 3.5620140758
[185] 1.8826827966 2.7143978266 1.3137222479 1.4720516785
[189] 1.0203054684 0.7697563121 0.4250454113 2.9347194065
[193] 0.0158247940 0.1760871132 1.3042477020 0.9534326850
[197] 1.4589447274 3.9310113663 -0.2173169124 3.7532367224
[201] 4.2165501262 2.4698370281 1.2134986498 2.4320394391
[205] 2.3568962647 2.0212741706 1.6759487896 1.0363975776
[209] -0.2304299553 0.9451336904 0.8592261068 3.0906265178
[213] 2.0199484433 2.4385917752 1.9597394593 1.2191129261
[217] 1.1176754439 0.9836559081 0.8772944336 0.7628223711
[221] 1.1394169338 0.2376478569 0.6512748265 0.1339470696
[225] 0.1481103953 -0.0663092510 -0.2666908693 0.4083130086
[229] 0.5924259439 4.8470365626 3.8304707186 3.5270776182
[233] 1.2283254820 6.2243631249 2.0261662432 -0.1103907584
[237] -0.0075436811 2.0803011170 3.2959340714 0.2729951512
[241] 0.4845700131 0.1116943675 2.9566985924 1.5589285989
[245] 1.1228669337 0.9475398234 1.1257831978 2.0140492707
[249] 1.1909985079 0.7909138684 -0.0831541250 0.7349808117
[253] 0.8458463115 1.3753343699 0.0227593486 0.2561434550
[257] 0.5404424443 0.3294140450 -0.0058435946 0.1926642122
[261] 1.2571020772 3.8766629153 -0.3573875790 0.1419303731
[265] 0.7593311430 1.4071984563 -0.0156561389 1.3373676721
[269] 0.8167020771 2.6289952319 -0.1850814909 -0.6099946293
[273] 0.7768046382 2.0335482436 1.2204829028 3.1189609994
[277] 1.7316814899 1.9216593991 2.2844136023 0.7094257995
[281] 1.1929239607 1.4289222844 0.2481104823 1.4596202713
[285] 1.0335789572 0.7707437197 1.6702884672 0.7545206592
[289] 0.5964409328 0.5339283681 1.8193010075 0.3880291468
[293] 0.4200514293 -0.1972680732 0.8625903572 0.2799402824
[297] 0.2687049953 0.1299848906 0.9992013356 1.9803766586
[301] 0.0910355769 -0.3121825269 0.1052536263 -0.1208084187
[305] 0.3534048888 -0.1511672969 0.0134937490 -0.1340538298
[309] -0.2877330180 -0.4595527723 -0.3430499585 -0.6436140371
[313] -0.1963965700 1.1936146098 -0.5590465410 2.2429879468
[317] 0.4267341761 -0.7079193212 0.1519186584 0.1607996291
[321] 0.8790023210 0.5613892721 0.2201746392 0.6845651179
[325] 0.0341000949 1.6485622432 2.2304321622 -0.0655276782
[329] 4.8554556980 4.7996565580 4.2658544002 -0.4571240398
[333] 1.2077744879 -0.3718450189 1.9385231620 1.8738734663
[337] 0.3313265254 0.2757510571 -0.3807291012 3.1111740935
[341] -0.5473596885 0.5886274977 2.9462439286 2.8830733063
[345] 0.4833838706 2.5955045256 1.5616842126 1.1161216914
[349] 2.1636059509 0.1425900083 1.1224803618 1.2257321986
[353] 1.0540079405 0.9049757224 0.7895547751 0.7529852552
[357] 2.3454210027 0.5196066855 0.5466000424 0.5055887588
[361] 0.7530778297 0.4423353498 0.4404231470 0.3995382276
[365] 0.7652759527 0.3614295346 0.3512914822 0.2934898000
[369] 0.2510533194 0.2369063991 0.1882610006 -0.7076613632
[373] 0.1812368955 1.3900046713 0.1424681144 -0.0145252314
[377] -0.0816800331 -0.1942899856 0.1116943675 -0.1592474990
[381] 0.1924811961 -0.7052700725 1.0471279197 2.8226667124
[385] 1.4030636479 2.7049522495 2.1843372877 1.8637713510
[389] 1.8136872572 1.9712413235 -0.4112761670 1.4585869782
[393] 1.1575603778 1.1348115981 0.2698662448 0.4315479468
[397] 0.2155704430 0.9214504300 0.9383821227 1.0032586894
[401] 0.5235001458 1.4953882192 0.0427793359 -0.0127910048
[405] 0.0226138619 0.1247928749 0.2049080308 -0.0296249516
[409] -0.0564193398 -0.1230052255 0.2405338666 -0.2479678012
[413] -0.2535630279 1.0932982912 1.5312665495 -0.5122745449
[417] 1.2982886197 -0.0714752050 0.4631169255 0.3986131548
[421] -0.2252648778 -0.2034199885 2.8358318786 0.7963591236
[425] 1.9355886226 5.2522299635 3.0091830489 1.6706836289
[429] 1.5565562847 1.4214590020 0.4972451496 1.3438520492
[433] 0.0693552092 1.6017798897 1.2364035659 1.2446515036
[437] 1.1956366836 1.1120413000 1.1613809267 1.0469614112
[441] 1.1647643728 0.9314037132 0.8987984174 0.8120332818
[445] 0.7970389770 0.7686845109 0.7690449918 0.6890014033
[449] 0.6771698238 0.6501018610 0.6240851890 0.6131973958
[453] 0.4931569279 0.4513371479 0.4033876431 0.5440041149
[457] 0.3778002730 0.7552724891 0.3615167477 0.4659030711
[461] 0.3014404826 0.2553621597 -0.6960457129 1.7709111566
[465] 0.1758698984 0.1200299858 0.0315486797 0.3112290834
[469] -0.0454621706 0.1005432988 -0.1318501423 -0.1543945627
[473] -0.1565190864 -0.3022295943 -0.1450044690 -0.2030833341
[477] -0.2276429770 -0.1810757346 -0.3943833915 -0.4019924820
[481] -0.4206534052 -0.4234682567 -0.4510397037 -0.4404542056
[485] -0.3084206751 -0.4527948644 -0.4870068833 -0.4245541552
[489] -0.6804171188 -0.3688466985 1.7857596533 5.4682106227
[493] 0.8084940208 1.0419582697 0.6495201625 0.2749087126
[497] 0.3752903899 1.1484576053 -0.6884908201 -0.4878807093
[501] -0.3282222936 4.0178979868 0.2628693408 4.6686233198
[505] 3.7639794817 2.6383962967 2.1133965156 -0.1925698124
[509] 1.5898693216 1.2578038873 1.2495920620 2.1454337427
[513] 1.0563223609 1.0277810074 -0.0971987416 0.7142370430
[517] 1.0113581018 1.6585510399 0.4172771896 0.3587113918
[521] 0.2922436601 0.2654080904 1.6404486313 0.8015709777
[525] 0.1072317868 -0.0159133665 -0.0736483022 -0.0214442425
[529] -0.0443218698 -0.0938466893 0.3680277854 -0.1014584824
[533] -0.1587654894 -0.1346512324 0.5118074937 -0.2020651609
[537] -0.3756801326 -0.2696019766 -0.4952380358 -0.7067271600
[541] -0.6290286261 -0.4011399261 0.6797473007 4.2008559543
[545] -0.1765692258 0.1039688906 -0.1678822277 0.8583519302
[549] 0.3178208627 0.0488770827 -0.0147832479 1.4571309279
[553] 0.9419941051 0.3963536479 0.2071367866 1.9672473271
[557] -0.3019936075 -0.2315682401 -0.4312562145 0.9601804837
[561] 1.3978652483 2.6221978225 5.6681618434 2.8572070003
[565] 1.5146333536 1.3547342180 1.6657773421 1.2852676400
[569] 1.0526153059 1.0399325437 0.3534048888 1.0090514970
[573] 0.9959380596 0.7617848415 -0.0905097131 0.4647377458
[577] 2.5001827148 0.4331700965 0.7366662749 0.3162632244
[581] 0.5125272285 0.2598658489 0.2416781556 0.4589273788
[585] 0.4318761282 0.0840517330 0.0585249592 0.1091905909
[589] -0.1100906692 -0.1478825755 -0.1543672301 -0.0005558928
[593] -0.2675031640 -0.2985575560 -0.2244285813 0.2023670753
[597] -0.1454876619 -0.4293690069 -0.3414723064 -0.4306293317
[601] -0.4992267731 -0.4185195321 -0.5094225439 -0.5844509826
[605] -0.6043750939 -0.1564333049 -0.6225764463 -0.3410678829
[609] -0.4331020214 1.0226421377 3.6821576948 0.3301751513
[613] 2.9660243646 -0.1920175502 0.4790016077 -0.6990281538
[617] -0.2748282786 -0.0500105328 -0.2849139300 -0.3055771909
[621] -0.1327621404 0.3580807839 -0.1599987737 0.5731815107
[625] 0.5174933373 -0.6213950224 2.4491418475 -0.0715805182
[629] 1.9624667178 1.8687130636 -0.2159604633 1.9536916008
[633] 1.7956095809 1.8056611359 1.0363975776 1.3258361087
[637] 1.4653421542 0.9826179111 0.7596510414 0.6618069449
[641] 0.7593545606 0.9807544133 0.6133499092 0.5197845009
[645] 0.3211195352 0.3099934179 0.3180005480 0.2224497772
[649] 0.1628659377 0.1047327871 0.5469863951 0.0785722791
[653] 0.0918886587 0.0573967835 -0.1388157108 -0.0894464433
[657] -0.1811973070 -0.2211788912 -0.2318302886 -0.2983487996
[661] -0.1671952161 -0.0721095382 -0.4565224591 -0.5617603158
[665] -0.4296289956 -0.6790224975 -0.3514888593 -0.5071780108
[669] -0.2543860161 -0.0762752291 -0.6757844797 2.4047270166
[673] -0.4224847350 4.5040485521 -0.3420801250 1.0743767657
[677] -0.7069960599 0.1429722706 0.4180624147 0.2415028528
[681] -0.2379681358 -0.4781350722 0.0825060153 1.0179997255
[685] 0.8698489590 2.3684017518 3.3701839174 1.3831837713
[689] 1.2904179336 1.7493052634 1.2696757135 1.7423196227
[693] 1.0664333582 0.8497450309 0.7919256869 1.1268310117
[697] 0.7705944201 0.8134103874 0.3959635992 0.6560231070
[701] 0.8422948962 0.6550391471 0.6161622188 0.8868539867
[705] 0.4996469147 0.4981685132 0.4852845619 0.4690167992
[709] 0.3987506944 0.6119301612 0.3953432027 0.3930048242
[713] 0.7528536612 0.6117083009 0.3808797002 0.4611228125
[717] 0.3678398023 0.3414900697 0.3969196276 0.2668485972
[721] 0.3916797543 0.2342849358 0.4294061996 0.1847181313
[725] 0.5804248612 0.1768400971 0.1543642784 0.1202941379
[729] 0.1099462481 0.0941106069 0.0777307966 0.0376520216
[733] 0.0343351322 0.0251380029 0.0227261872 0.0303960347
[737] 0.1165043985 0.2035390475 -0.0105152094 -0.0218138684
[741] 0.0341728164 -0.0271310795 3.0573943977 0.0000555925
[745] -0.0790008076 -0.0361078385 -0.0749584276 -0.1605281151
[749] -0.1680425129 -0.1155315126 -0.1700196069 -0.1780663993
[753] -0.0916592173 -0.0781343297 -0.1953489167 -0.1857311484
[757] -0.0756348334 -0.2124221518 -0.2387939288 -0.1225946372
[761] -0.2268403532 -0.2453870374 -0.2596406733 -0.2329489979
[765] -0.2928169741 -0.3270199502 -0.2824095982 -0.3240192632
[769] -0.3192237094 8.3971662273 -0.2688648430 -0.3790934824
[773] -0.5169404477 -0.4420600084 -0.5003366443 -0.7077259330
[777] -0.2527718134 -0.5356428009 -0.3359304010 -0.3813698621
[781] -0.4555911338 -0.4190690333 -0.5969460102 -0.6418023558
[785] -0.6433920599 -0.5595358987 4.5952098434 -0.5317871768
[789] 4.4067489753 0.4609489267 -0.0025825537 -0.1933742038
[793] 0.0766541161 -0.2522781315 -0.2759312691 -0.0555482602
[797] 0.1703381897 0.0205569028 0.1828352625 -0.1685436743
[801] 0.0416189630 -0.2942205358 0.0482899936 -0.3351192166
[805] 0.9428145076 -0.0381045227 4.1082615481 2.4667721219
[809] 1.7202554880 1.3605189763 1.2526788081 1.1730815112
[813] 1.8860641974 0.8296912832 0.8164113374 0.8565359541
[817] 0.7339781089 0.7575970917 0.7751645346 0.6624503792
[821] 0.6271689841 1.6670948594 0.6024365073 0.5044570332
[825] 0.4423110704 0.3159793361 0.2614477813 0.2591488313
[829] 0.2182549860 0.1454172040 0.1236454013 0.2962849737
[833] 0.2885138158 -0.3422511475 0.1063403721 0.1023358136
[837] 0.0222984630 -0.1001974418 -0.1448377122 0.4042058250
[841] -0.2062416037 -0.2078769158 -0.2099228162 -0.2138707080
[845] -0.2190635855 -0.2544414994 -0.1864210818 -0.4078374860
[849] -0.4367174660 0.0402814903 -0.4704532603 -0.3303058111
[853] -0.5200333586 -0.5405508114 -0.4730223957 0.0395963048
[857] -0.6091823346 -0.1318825148 -0.6179509508 0.4846646474
[861] 0.3138418984 -0.5695088889 0.2659877144 -0.3159835442
[865] 0.3964167569 0.8725928859 -0.6253682016 -0.6025587672
[869] 0.3193353619 0.1435937628 0.1302786250 -0.0476428496
[873] 0.2059097109 -0.2175810791 0.3633881488 -0.3423863644
[877] -0.3743497598 -0.6239774370 1.6941087998 0.6902884472
[881] 1.0257364510 1.3912584660 0.9058533174 0.4645789654
[885] -0.1765101050 -0.1670133394 -0.2028804357 -0.0880912213
[889] -0.3673139970 -0.3717576013 0.6150105964 0.3525529757
[893] -0.1953967159 3.6251919001 3.2019581185 0.2042994380
[897] 1.7096636936 1.5361259428 2.4857974996 1.4487178111
[901] 1.2643211044 -0.6762757219 1.1355955668 1.1468711735
[905] 1.1260322884 0.8376421849 2.0911844692 0.8297110193
[909] 0.7189136246 1.1339237187 0.6217758961 1.4878348896
[913] 1.1618037571 0.5848719277 0.4827989729 0.4755661552
[917] 0.3966737947 0.4598733419 0.5871148100 0.4005648591
[921] 0.5226429005 0.3929599759 0.3686251588 0.3964338782
[925] 0.2827512041 0.6277445616 0.2725928313 0.3218032453
[929] 0.1753292646 0.1441596256 0.2561406939 0.0953803250
[933] 0.1053812613 0.0625840806 0.0967733101 0.0342845573
[937] 0.0636058475 0.0245746966 0.0040428106 0.0224790833
[941] -0.0045823495 -0.0029630046 -0.0217050492 -0.0545096497
[945] 0.1206035327 -0.0582055291 -0.0133653113 -0.0855829306
[949] -0.1020583686 -0.0199161865 -0.1053588818 0.0331858471
[953] -0.1207454557 -0.1104864883 -0.1443020599 -0.1357262330
[957] -0.1269456377 -0.1604352046 -0.1513933936 -0.1942941052
[961] -0.2288929589 -0.2165712036 -0.2297461576 -0.2424077958
[965] -0.2653228064 -0.3038648917 -0.3126415280 -0.3192177345
[969] -0.3203992607 -0.3253165477 -0.3362582172 -0.3368904321
[973] -0.3697296840 -0.3573500788 -0.4101857398 -0.4218174742
[977] -0.4287637449 -0.3217705521 -0.4580300338 -0.4381991836
[981] -0.5016159164 -0.3931335557 -0.3971333809 -0.5538430284
[985] -0.4645071358 -0.5561248279 -0.5688621531 -0.5599634915
[989] -0.5649627617 -0.4087451600 -0.4239871822 -0.5859874385
[993] -0.2867850243 -0.6135161263 -0.6161426295 -0.5516431245
[997] -0.5803420168 -0.0666539401 -0.3952333617 -0.5912713567
[ reached getOption("max.print") -- omitted 3159 entries ]
hist(zscore)
Given a sales value of 25000, calculate the corresponding z-value or z-score using the mean and standard deviation calculations conducted in task 1.
We know that the z-score = (x - mean)/sd. So, input this into the R code where x=25000, mean=16717.2, and stdev = 2617.0521 which we found above.
Based on the z-values, how would you rate a $25000 sales value: poor, average, good, or very good performance? Explain your logic.