1. state the definition of sample as it appears on page 16
Data are collected from a sample, which is a subset of the population.
2. state the definition of population, as it appears on page 16
A population includes all individuals or objects of interest.
3. state the definition of statistical inference as it appears on page 17
Statistical inference is the process of using data from a sample to gain information about the population.
4. import the HollywoodMovies2011 dataset
HollywoodMovies2011 <- read.csv("C:/Users/k13fl01/Desktop/Math 260/HollywoodMovies2011.csv")
5. use the nrow() command to determine that there are 136 cases in the dataset
nrow(HollywoodMovies2011)
## [1] 136
6. use the concatenate command c() to generate a list of all counting numbers between 1 and 136
## [1] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
## [18] 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
## [35] 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
## [52] 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
## [69] 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85
## [86] 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102
## [103] 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119
## [120] 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136
7. use the sampling command sample() to select five of the numbers in your list at random
sample(c(1:136),5)
## [1] 28 68 51 25 130
8. Display all variable values for the five films corresponding to your random sample using the square bracket notation
HollywoodMovies2011[sample(c(1:136),5), ]
## Movie LeadStudio RottenTomatoes
## 62 Abduction Vertigo Entertainment 4
## 125 Mars Needs Moms Disney 36
## 57 Paul Relativity 72
## 126 Dylan Dog: Dead of Night Independent 6
## 26 Kung Fu Panda 2 DreamWorks Animation 82
## AudienceScore Story Genre TheatersOpenWeek
## 62 46 Maturation Action 3118
## 125 43 Rescue Animation 3117
## 57 70 Comedy Comedy 2802
## 126 28 Monster Force Horror NA
## 26 80 Rivalry Animation 3925
## BOAverageOpenWeek DomesticGross ForeignGross WorldGross Budget
## 62 3504 28.07 54.00 82.069 35
## 125 2218 21.39 17.60 38.992 150
## 57 4655 37.41 60.57 97.983 40
## 126 NA 1.19 3.45 4.633 20
## 26 12142 165.25 497.78 663.024 150
## Profitability OpeningWeekend
## 62 2.3448286 10.93
## 125 0.2599467 6.91
## 57 2.4495750 13.04
## 126 0.2316500 0.75
## 26 4.4201600 47.66