AlbertChang_Quiz1

pdf

School

University of Washington *

*We aren’t endorsed by this school

Course

311

Subject

Statistics

Date

Feb 20, 2024

Type

pdf

Pages

8

Uploaded by PrivateIron365

Report
Quiz 1 Albert Chang 1/31/2024 Question 1: Data1 <- c ( 25 , 27 , 31 , 26 , 44 , 28 , 71 , 60 , 41 , 26 , 27 , 52 , 79 , 34 ) a) mean (Data1) ## [1] 40.78571 median (Data1) ## [1] 32.5 print ( "Mode: 26 and 27" ) ## [1] "Mode: 26 and 27" Mean = 40.79 Median = 32.5 Mode = 26 and 27 b) max (Data1) - min (Data1) ## [1] 54 1
sd (Data1) ## [1] 18.08177 IQR (Data1) ## [1] 23 Range = 54 Standard Deviation = 18.08 IQR = 23 c) boxplot (Data1) 30 40 50 60 70 80 This is right skewed. As you can see from the boxplot, the shape is right-skewed. The shape is a right skewed because the mean is greater than the median. d) We should use the median would best represent a typical observation in the data because it won’t be affeted by the extremes. And we should use IQR as there are plenty of outliers. 2
e) newdata <- Data1 / 6.25 mean (newdata) ## [1] 6.525714 median (newdata) ## [1] 5.2 sd (newdata) ## [1] 2.893084 IQR (newdata) ## [1] 3.68 Mean = 6.53 Median = 5.2 Standard deviation = 2.89 IQR = 3.68 Question 2: a) Data2 <- read.csv ( ' /Users/handsomeguy/Downloads/Handout1.csv ' , header= TRUE , stringsAsFactors= FALSE ) glimpse (Data2) ## Rows: 150 ## Columns: 11 ## $ COMMIT <int> 48, 20, 40, 20, 26, 48, 56, 49, 43, 66, 28, 65, 46, 43, 34, ~ ## $ AGE <int> 30, 30, 26, 27, 24, 30, 30, 25, 27, 30, 32, 28, 29, 29, 27, ~ ## $ SEX <int> 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, ~ ## $ SCHTYPE <int> 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, ~ ## $ SCHLEVEL <int> 1, 3, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, ~ ## $ SALARY <dbl> 42.277, 40.147, 41.826, 37.000, 39.032, 40.785, 40.355, 43.6~ ## $ CLASSSIZE <int> 26, 21, 28, 22, 25, 23, 18, 19, 25, 15, 28, 23, 22, 23, 17, ~ ## $ RESOURCES <int> 5, 5, 7, 7, 7, 5, 5, 4, 8, 6, 8, 8, 6, 9, 3, 9, 8, 5, 9, 7, ~ ## $ AUTONOMY <int> 12, 11, 9, 5, 10, 10, 13, 10, 10, 12, 12, 13, 14, 11, 9, 13,~ ## $ CLIMATE <int> 12, 9, 10, 10, 11, 9, 15, 15, 11, 16, 5, 15, 13, 8, 8, 14, 1~ ## $ SUPPORT <int> 12, 11, 12, 8, 9, 13, 13, 14, 13, 14, 11, 13, 10, 10, 12, 12~ There are 150 participants 3
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
b) Data2 %>% summarise ( med_com = median (COMMIT), mean_com = mean (COMMIT), sd_com = sd (COMMIT), IQR_com = IQR (COMMIT) ) ## med_com mean_com sd_com IQR_com ## 1 50.5 50.02 15.00088 22.5 boxplot (Data2 $ COMMIT) 20 30 40 50 60 70 80 Median = 50.5 Mean = 50.02 Standard Deviation = 15.00 IQR = 22.50 Looking at the boxplot, we can see that the shape of it is a normal distribution. We should use mean and standard deviation because these two are the best ways to measure of central tendency. 4
c) addmargins ( table (Data2 $ SCHTYPE, Data2 $ SEX)) ## ## 1 2 Sum ## 1 40 12 52 ## 2 34 29 63 ## 3 5 30 35 ## Sum 79 71 150 From this table we can see that there is a higher proportion of males from traditional populations. The ratio of boys to girls in private schools is roughly the same, which is a moderate. Lastly, there is a higher proportion of women from Charter/Magnet d) male_com <- Data2 %>% filter (SEX == ' 1 ' ) male_com %>% summarise ( med_male = median (COMMIT), mean_male = mean (COMMIT), sd_male = sd (COMMIT), IQR_male = IQR (COMMIT) ) ## med_male mean_male sd_male IQR_male ## 1 48 47.94937 14.68463 20.5 boxplot (male_com $ COMMIT, main = "Male Commit Boxplot" ) 5
20 30 40 50 60 70 Male Commit Boxplot female_com <- Data2 %>% filter (SEX == ' 2 ' ) female_com %>% summarise ( med_female = median (COMMIT), mean_female = mean (COMMIT), sd_female = sd (COMMIT), IQR_female = IQR (COMMIT), ) ## med_female mean_female sd_female IQR_female ## 1 52 52.32394 15.11553 22.5 boxplot (female_com $ COMMIT, main = "Female Commit Boxplot" ) 6
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
20 30 40 50 60 70 80 Female Commit Boxplot Male Commit: Median = 48 Mean = 47.95 Standard Deviation = 14.68 IQR = 20.5 Female Commit: Median = 52 Mean = 52.32 Standard Deviation = 15.12 IQR = 22.5 Both of the boxplot has a shape of normal distribution. However, the range of commit in female is larger than male. Additionally, since box of female is larger than male’s box, female’s IQR is higher than male’s. Lastly, the mean of female is higher than male’s because the line in the middle is higher. Question 3: a) The shape of this graph is a right skewed because the median is less than the mean. 7
b) In my opinion, the life span of the general population would be unimodal. Since the mortality rates will be higher among the elderly and infants, we can expect shorter lifespans on both the left and right sides of the distribution. In addition, this is a left skewed graph since most of the people live around 80 years which makes the tail longer on its left side . c) The standard deviation will be 0 when all data sets are the same. Standard deviation can’t be negative because the square root of any number is always positive. D) I would use systemetic because systemetic selects each data at regular intervals. In this case, every 100th microchip is selected for inspection as they proceed past the inspection point. Therefore, systemetic is the best method. Statement: I will follow a reasonable code of conduct as described in point 8 above. I will neither give nor receive un-authorized aid 8