Question

2. In United States, a government shutdoun occurs when Congress fails to pass a bill or a continuing resolution to fund federal government operations and agencies or when the President refuses to sign such a bill or resoution. During a shutdown, some federal employees should take a furlough (temporary leave of employees), and some federal employees are still required to work without pay until the shutdown ends. The duration of a shutdown is random depending, and it prolongs when a conflict between Congress and the President cannot find a compromising solution. Download shutdovn.csvwhich includes records of 21 government shutdowns. It contains five columns president: U.S. President during shutdown . year: year of shutdown e month: month of shutdown . day: starting day of shutdown e duration: duration of shutdown The last row has a column with NA which means not available. (The shutdown is still ongoing, as of January 18, 2019.) > data read. CSV( file . choose() ) # # READ shut down, csv head (data) president year month day duration Ford 1976 Carter 1977 Carter 1977 Carter 1977 Carter 1978 Carter 1979 9 30 9 30 10 31 11 30 9 30 9 30 12 >xdatasduration [1 10 12 8 8 18 11 21 3 3 21 13 5 21 16 3 1 NA Statisticians often use notation (XX) to denote n data points. It is called a sample of size n. We have a sample of size n- 20 excluding NA > length (x) [11 21 > sum is.na(x)FALSE [1) 20 Our learning objective is to summarize a sample by quantifying central tendency (sample mean and median) and dispersion (sample variance and standard deviation)
Sample mean: The sample mean is defined as 8-1 (Xi +--+ Xn), and it measures central tendency of a sample > nean () [1) NA [1 6.5 The average duration of shutdowns is 6.5 days. Sample median: Another way to measure the central tendency is the sample median which is defined as the middle value of an ordered sample from smallest to largest >sort (x) > sort (x) [10] 1 3 >sort () [11 > median (x) [1 NA > 鱼ed i an ( x, na.rn.TRUE ) Since there are two middle mumbers, 3 and 3, the median is at the middle of 3 and 3 which is 3. Historically 50% of shutdowns lasted for three days or shorter. Sample variance: The sample variance is defined as Sa_ (X1-X)2 +--+ (x,-x)2. In some sense, it measures dispersion of a sample. A larger value of S2 means more dispersion among data points. 1 10 12 8 8 18 1 21 3 3 21 1 3 5 21 16 31NA [1) 10 12 8 8 18 11 2 1 3 3 2 1 1 13 5 21 16 3 1 >mean x[1:20]) C1 6.5 > x1:20]6.5 2 [1) 12.25 30.25 2.25 2.25 132.25 20.25 20.25 30.25 12.25 12.25 [11) 20.25 30.25 30.25 30.25 12.25 2.25 210.25 90.25 12.25 30.25 > sun( ( x[1:20] -6.5 ) -2 ) [1) 743 > sum x[1:20]6.5 219 1 39.10526 > var(x) [1) NA > var . na.rm-TRUE [1) 39.10526 The sample variance is 39.1 days2 Sample standard deviation: The unit of sample variance is the original unit square (eg., days2) which is weird. Some people prefer to take a square root of the sample variance, and S-VS2 is called the sample standard deviation. It measures the dispersion in the original unit > sqrt var x, na.rm-TRUE 1 6.25342 1 6.25342 The sample standard deviation is 6.25 days.
Dot plot: We can visualize the data using a dot plot (which is called stripchart in R) > stripchart (x) > stripchart( x, xlin-c(0,25) > stripchart ( x, x1in.c(0,25), me thod.stack ) > stripchart( x, xlim-c(0,25) mthod- stack, pch-19 > stripchart( x, xlim-c(0,25), method-stack, pch 19, main- Shutdon) Histogram: A histogram (which is called hist in R) is another method of data visualization. > hist (x) > histx, breaks-seq C0,25,1)) > hist x, breaks seq (0,25,1), col-red) > hist x, breaks- seq Co,30,2), col-2, ain-Shutdownxlab-days, ylab-count The last histogram provides the same information as below > cutx, breaks-seq C0,30,2) [1] (8,10 (10,12] (6,8 (6,8(16,18] (10,12] (0,2] (0,2) (2,4 [10) (2,4) 0,2] (0,2] (,2 (0,2] 2,4 (4,6] (20,22) (14,16 [191 (2,4 (0,2 <NA> 15 Levels: (0,2] (2,4) (4,6] (6,8) (8,10] (10,12] (12,14] (14,16] . (28,30] > table cut x, breaks seq C0,30,2) (0,2 (2,4 (4,6] (6,8 (8,101 (10,12] (12,14] (14,16] (16,181 (18,20] (20,22] (22,24] (24,26] (26,28] (28,30]
media%2F60a%2F60a04996-61e4-43cc-8baa-c3
media%2F8b4%2F8b4c94e0-b389-425a-9513-b4
58 46 59 60 33 61 18 62 41 63 12 64 34 65 35 66 27 67 34 68 31 69 14 70 19 71 33 72 33 73 20 74 26 75 31 76 29 77 39 78 21 79 27 8017 81 37 82 46 2
0 0
Add a comment Improve this question Transcribed image text
Answer #1

(a). The sample size excluding NA is 79

(b). The average point per game during the season is: 31.62025

(c). The sample median is  31. Here, we notice that the median is slightly less than the mean, which means that the data is skewed towards the right, with long tail of high scores, which pulls the mean up to the median.

(d). The sample variance is 88.52061.

(e). The sample standard deviation is  9.408539

(f). The R code for the histogram is as follows:

x=c(40,25,53,30,38,34,24,22,28,46,34,37,40,27,29,24,45,29,26,40,44,28,29,38,28,25,26,38,29,23,5,30,17,26,38,31,38,26,38,35,25,39,37,34,23,53,51,26,35,26,31,23,36,42,51,46,33,18,41,12,34,35,27,34,31,14,19,33,33,20,26,31,29,39,21,27,17,37,46)
length(x)
mean(x)
median(x)
var(x)
sd(x)
hist(x, main= "Curry", xlim = c(0,60), ylim = c(0,20), xlab = "points", ylab = "Frequency", col = "yellow")

(g). The percentage of games where he scored more than 20 points is 89.87%

(length(x[x>20])/length(x))*100

Add a comment
Know the answer?
Add Answer to:
2. In United States, a government shutdoun occurs when Congress fails to pass a bill or...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT