data<-read.csv("Influenza_Vaccination_Coverage_for_All_Ages__6__Months_[79] 1.csv",header=T)
attach(data)
names(data)
##  [1] "Vaccine"        "Geography.Type" "Geography"      "FIPS"          
##  [5] "Season"         "Month"          "Dimension.Type" "Dimension"     
##  [9] "Estimate...."   "X95..CI...."    "Sample.Size"    "Interactions"
str(data)
## 'data.frame':    163890 obs. of  12 variables:
##  $ Vaccine       : Factor w/ 3 levels "Any Influenza Vaccination, Seasonal or H1N1",..: 1 1 1 1 1 1 1 1 1 1 ...
##  $ Geography.Type: Factor w/ 3 levels "Counties","HHS Regions/National",..: 3 3 3 3 3 3 3 3 3 3 ...
##  $ Geography     : Factor w/ 1933 levels "Abbeville","Acadia Parish",..: 10 15 60 61 253 387 399 477 499 595 ...
##  $ FIPS          : int  1 2 4 5 6 8 9 10 11 12 ...
##  $ Season        : Factor w/ 12 levels "2009-10","2010-11",..: 1 1 1 1 1 1 1 1 1 1 ...
##  $ Month         : int  8 8 8 8 8 8 8 8 8 8 ...
##  $ Dimension.Type: Factor w/ 8 levels "≥18 Years","≥65 Years",..: 7 7 7 7 7 7 7 7 7 7 ...
##  $ Dimension     : Factor w/ 28 levels "≥18 Years","≥6 Months",..: 2 2 2 2 2 2 2 2 2 2 ...
##  $ Estimate....  : Factor w/ 914 levels "0","0.1","0.2",..: 17 10 10 8 10 914 9 8 13 12 ...
##  $ X95..CI....   : Factor w/ 46568 levels "","0.0 to 0.0",..: 77 58 70 41 70 46568 49 41 53 72 ...
##  $ Sample.Size   : int  9441 5058 8321 5931 18039 10831 8657 7226 6501 25335 ...
##  $ Interactions  : int  75528 40464 66568 47448 144312 86648 69256 57808 52008 202680 ...
dim(data)
## [1] 163890     12

Descriptive Statistics

summary(data)
##                                         Vaccine      
##  Any Influenza Vaccination, Seasonal or H1N1:  8011  
##  Influenza A (H1N1) 2009 Monovalent         :  6447  
##  Seasonal Influenza                         :149432  
##                                                      
##                                                      
##                                                      
##                                                      
##               Geography.Type           Geography           FIPS      
##  Counties            :  9379   Washington   :  2558   Min.   :    1  
##  HHS Regions/National: 26900   Delaware     :  2475   1st Qu.:   20  
##  States/Local Areas  :127611   Hawaii       :  2475   Median :   37  
##                                Texas        :  2474   Mean   : 1779  
##                                Ohio         :  2473   3rd Qu.:   56  
##                                United States:  2472   Max.   :56045  
##                                (Other)      :148963                  
##      Season          Month               Dimension.Type  
##  2009-10:22468   Min.   : 1.000   Age           :119556  
##  2018-19:18434   1st Qu.: 3.000   Race/Ethnicity: 39749  
##  2019-20:16574   Median : 5.000   ≥18 Years     :  3545  
##  2020-21:13497   Mean   : 6.144   ≥65 Years     :   208  
##  2017-18:13214   3rd Qu.:10.000   18-49 Years   :   208  
##  2014-15:12585   Max.   :12.000   18-64 Years   :   208  
##  (Other):67118                    (Other)       :   416  
##                Dimension       Estimate....        X95..CI....    
##  ≥18 Years          : 15502   NR †   : 13280   NR †      : 13280  
##  6 Months - 17 Years:  9367   1.1    :   552   NR *      :   526  
##  ≥65 Years          :  9228   NR *   :   526             :   518  
##  ≥6 Months          :  9113   NR     :   518   0.2 to 0.6:   371  
##  White, Non-Hispanic:  9108   43     :   490   0.1 to 0.1:   306  
##  Hispanic           :  9098   40.7   :   472   0.3 to 1.1:   243  
##  (Other)            :102474   (Other):148052   (Other)   :148646  
##   Sample.Size      Interactions    
##  Min.   :    30   Min.   :      0  
##  1st Qu.:   719   1st Qu.:   2544  
##  Median :  1899   Median :   8551  
##  Mean   :  6359   Mean   :  38529  
##  3rd Qu.:  5039   3rd Qu.:  26444  
##  Max.   :518465   Max.   :6221580  
##  NA's   :11251

Multiple Linear Regression

model<-lm(Month~Sample.Size+Vaccine+Geography.Type)
summary(model)
## 
## Call:
## lm(formula = Month ~ Sample.Size + Vaccine + Geography.Type)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -5.5613 -3.5141  0.4857  3.4858  6.0042 
## 
## Coefficients:
##                                             Estimate Std. Error t value
## (Intercept)                                6.505e+00  4.722e-02 137.738
## Sample.Size                                5.796e-08  4.171e-07   0.139
## VaccineInfluenza A (H1N1) 2009 Monovalent -4.913e-01  6.203e-02  -7.921
## VaccineSeasonal Influenza                  2.695e-02  4.256e-02   0.633
## Geography.TypeStates/Local Areas          -1.757e-02  2.629e-02  -0.668
##                                           Pr(>|t|)    
## (Intercept)                                < 2e-16 ***
## Sample.Size                                  0.890    
## VaccineInfluenza A (H1N1) 2009 Monovalent 2.37e-15 ***
## VaccineSeasonal Influenza                    0.527    
## Geography.TypeStates/Local Areas             0.504    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 3.679 on 152634 degrees of freedom
##   (11251 observations deleted due to missingness)
## Multiple R-squared:  0.0007915,  Adjusted R-squared:  0.0007653 
## F-statistic: 30.23 on 4 and 152634 DF,  p-value: < 2.2e-16

Multiple Linear Regression without Interactions

model1<-lm(Month~Sample.Size+Vaccine+Geography.Type+Interactions)
summary(model1)
## 
## Call:
## lm(formula = Month ~ Sample.Size + Vaccine + Geography.Type + 
##     Interactions)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -23.7655  -3.3712   0.4687   3.3578  23.7293 
## 
## Coefficients:
##                                             Estimate Std. Error t value
## (Intercept)                                6.504e+00  4.567e-02 142.430
## Sample.Size                               -6.664e-05  7.630e-07 -87.340
## VaccineInfluenza A (H1N1) 2009 Monovalent -4.551e-01  5.998e-02  -7.588
## VaccineSeasonal Influenza                  2.483e-02  4.115e-02   0.603
## Geography.TypeStates/Local Areas          -1.660e-02  2.542e-02  -0.653
## Interactions                               1.026e-05  9.959e-08 102.984
##                                           Pr(>|t|)    
## (Intercept)                                < 2e-16 ***
## Sample.Size                                < 2e-16 ***
## VaccineInfluenza A (H1N1) 2009 Monovalent 3.27e-14 ***
## VaccineSeasonal Influenza                    0.546    
## Geography.TypeStates/Local Areas             0.514    
## Interactions                               < 2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 3.558 on 152633 degrees of freedom
##   (11251 observations deleted due to missingness)
## Multiple R-squared:  0.06571,    Adjusted R-squared:  0.06568 
## F-statistic:  2147 on 5 and 152633 DF,  p-value: < 2.2e-16

Correlation

cor(Month,Interactions,method="pearson")
## [1] 0.1409833
cor(Month,Interactions,method="spearman")
## [1] 0.5440468
cor.test(Month,Interactions,method="pearson")
## 
##  Pearson's product-moment correlation
## 
## data:  Month and Interactions
## t = 57.65, df = 163888, p-value < 2.2e-16
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  0.1362349 0.1457252
## sample estimates:
##       cor 
## 0.1409833
cor.test(Month,Interactions,method="spearman")
## Warning in cor.test.default(Month, Interactions, method = "spearman"): Cannot
## compute exact p-value with ties
## 
##  Spearman's rank correlation rho
## 
## data:  Month and Interactions
## S = 3.3452e+14, p-value < 2.2e-16
## alternative hypothesis: true rho is not equal to 0
## sample estimates:
##       rho 
## 0.5440468

Scatter Plot

plot(Interactions~Month,main="Month vs Interactions",col=2)

Graphical Representation

library(ggplot2)
ggplot(data=data,aes(factor(Month),Interactions))+geom_boxplot()

## With jitters
ggplot(data=data,aes(factor(Month),Interactions))+geom_boxplot()+geom_jitter(colour="BLUE")