In: Statistics and Probability
Back to the Harris county SARS-Cov2 new cases data set: Here you have two subsets of the timeline of 30 consecutive days.
27 80 51 18 26 216 81 37 117 167 108 151 178 111 414 337 195 706 214 300 68 118 160 190 209 154 193 170 154 166
337 483 163 332 320 314 312 324 380 210 504 425 450 395 1187 1135 179 1994 1374 1365 1231 1238 908 113 1453 693 1437 1249 1208 597
Solution-:
By using RStudio:
>x=c(27,80,51,18,26,216,81,37,117,167,108,151,178,111,414,337,195,706,214,300,68,118,160,190,209,154,193,170,154,166);x
[1] 27 80 51 18 26 216 81 37 117 167 108 151 178 111 414 337 195
706 214 300
[21] 68 118 160 190 209 154 193 170 154 166
>
y=c(337,483,163,332,320,314,312,324,380,210,504,425,450,395,1187,1135,179,1994,1374,1365,1231,1238,908,113,1453,693,1437,1249,1208,597);y
[1] 337 483 163 332 320 314 312 324 380 210 504 425 450 395 1187
1135
[17] 179 1994 1374 1365 1231 1238 908 113 1453 693 1437 1249 1208
597
> #(a)For Scatter diagram
> plot(x,y,main="Scatter Diagram of x & y")
> #Comment: This scatter diagram shows positive correlation.
> #For Correlation
> r=cor(x,y);r
[1] 0.6398427
> round(r,2)
[1] 0.64
R-Code:
x=c(27,80,51,18,26,216,81,37,117,167,108,151,178,111,414,337,195,706,214,300,68,118,160,190,209,154,193,170,154,166);x
y=c(337,483,163,332,320,314,312,324,380,210,504,425,450,395,1187,1135,179,1994,1374,1365,1231,1238,908,113,1453,693,1437,1249,1208,597);y
#(a)For Scatter diagram
plot(x,y,main="Scatter Diagram of x & y")
#Comment: This scatter diagram shows positive correlation.
#For Correlation
r=cor(x,y);r
round(r,2)
The value of r=0.63 so that there is positive correlation (association) between x and y.
Therefore, it indicate one of the proliferation of infection increase then then another proliferation of infection is also increases.