Reading in the data

Also creating two subsets to view the data based on seeding

library(ggplot2)
## Warning: package 'ggplot2' was built under R version 4.0.5
clouds = read.csv("clouds.csv")
clouds
##     X seeding time  sne cloudcover prewetness echomotion rainfall
## 1   1      no    0 1.75       13.4      0.274 stationary    12.85
## 2   2     yes    1 2.70       37.9      1.267     moving     5.52
## 3   3     yes    3 4.10        3.9      0.198 stationary     6.29
## 4   4      no    4 2.35        5.3      0.526     moving     6.11
## 5   5     yes    6 4.25        7.1      0.250     moving     2.45
## 6   6      no    9 1.60        6.9      0.018 stationary     3.61
## 7   7      no   18 1.30        4.6      0.307     moving     0.47
## 8   8      no   25 3.35        4.9      0.194     moving     4.56
## 9   9      no   27 2.85       12.1      0.751     moving     6.35
## 10 10     yes   28 2.20        5.2      0.084     moving     5.06
## 11 11     yes   29 4.40        4.1      0.236     moving     2.76
## 12 12     yes   32 3.10        2.8      0.214     moving     4.05
## 13 13      no   33 3.95        6.8      0.796     moving     5.74
## 14 14     yes   35 2.90        3.0      0.124     moving     4.84
## 15 15     yes   38 2.05        7.0      0.144     moving    11.86
## 16 16      no   39 4.00       11.3      0.398     moving     4.45
## 17 17      no   53 3.35        4.2      0.237 stationary     3.66
## 18 18     yes   55 3.70        3.3      0.960     moving     4.22
## 19 19      no   56 3.80        2.2      0.230     moving     1.16
## 20 20     yes   59 3.40        6.5      0.142 stationary     5.45
## 21 21     yes   65 3.15        3.1      0.073     moving     2.02
## 22 22      no   68 3.15        2.6      0.136     moving     0.82
## 23 23     yes   82 4.01        8.3      0.123     moving     1.09
## 24 24      no   83 4.65        7.4      0.168     moving     0.28
seedy = subset(clouds, seeding == "yes")
seedy
##     X seeding time  sne cloudcover prewetness echomotion rainfall
## 2   2     yes    1 2.70       37.9      1.267     moving     5.52
## 3   3     yes    3 4.10        3.9      0.198 stationary     6.29
## 5   5     yes    6 4.25        7.1      0.250     moving     2.45
## 10 10     yes   28 2.20        5.2      0.084     moving     5.06
## 11 11     yes   29 4.40        4.1      0.236     moving     2.76
## 12 12     yes   32 3.10        2.8      0.214     moving     4.05
## 14 14     yes   35 2.90        3.0      0.124     moving     4.84
## 15 15     yes   38 2.05        7.0      0.144     moving    11.86
## 18 18     yes   55 3.70        3.3      0.960     moving     4.22
## 20 20     yes   59 3.40        6.5      0.142 stationary     5.45
## 21 21     yes   65 3.15        3.1      0.073     moving     2.02
## 23 23     yes   82 4.01        8.3      0.123     moving     1.09
seedn = subset(clouds, seeding == "no")
seedn
##     X seeding time  sne cloudcover prewetness echomotion rainfall
## 1   1      no    0 1.75       13.4      0.274 stationary    12.85
## 4   4      no    4 2.35        5.3      0.526     moving     6.11
## 6   6      no    9 1.60        6.9      0.018 stationary     3.61
## 7   7      no   18 1.30        4.6      0.307     moving     0.47
## 8   8      no   25 3.35        4.9      0.194     moving     4.56
## 9   9      no   27 2.85       12.1      0.751     moving     6.35
## 13 13      no   33 3.95        6.8      0.796     moving     5.74
## 16 16      no   39 4.00       11.3      0.398     moving     4.45
## 17 17      no   53 3.35        4.2      0.237 stationary     3.66
## 19 19      no   56 3.80        2.2      0.230     moving     1.16
## 22 22      no   68 3.15        2.6      0.136     moving     0.82
## 24 24      no   83 4.65        7.4      0.168     moving     0.28

Viewing the subests

summary(seedy)
##        X           seeding               time            sne       
##  Min.   : 2.00   Length:12          Min.   : 1.00   Min.   :2.050  
##  1st Qu.: 8.75   Class :character   1st Qu.:22.50   1st Qu.:2.850  
##  Median :13.00   Mode  :character   Median :33.50   Median :3.275  
##  Mean   :12.83                      Mean   :36.08   Mean   :3.330  
##  3rd Qu.:18.50                      3rd Qu.:56.00   3rd Qu.:4.032  
##  Max.   :23.00                      Max.   :82.00   Max.   :4.400  
##    cloudcover       prewetness      echomotion           rainfall     
##  Min.   : 2.800   Min.   :0.0730   Length:12          Min.   : 1.090  
##  1st Qu.: 3.250   1st Qu.:0.1237   Class :character   1st Qu.: 2.683  
##  Median : 4.650   Median :0.1710   Mode  :character   Median : 4.530  
##  Mean   : 7.683   Mean   :0.3179                      Mean   : 4.634  
##  3rd Qu.: 7.025   3rd Qu.:0.2395                      3rd Qu.: 5.468  
##  Max.   :37.900   Max.   :1.2670                      Max.   :11.860
mean(seedy$rainfall)
## [1] 4.634167
sd(seedy$rainfall)
## [1] 2.776841
summary(seedn)
##        X           seeding               time            sne       
##  Min.   : 1.00   Length:12          Min.   : 0.00   Min.   :1.300  
##  1st Qu.: 6.75   Class :character   1st Qu.:15.75   1st Qu.:2.200  
##  Median :11.00   Mode  :character   Median :30.00   Median :3.250  
##  Mean   :12.17                      Mean   :34.58   Mean   :3.008  
##  3rd Qu.:17.50                      3rd Qu.:53.75   3rd Qu.:3.837  
##  Max.   :24.00                      Max.   :83.00   Max.   :4.650  
##    cloudcover       prewetness      echomotion           rainfall     
##  Min.   : 2.200   Min.   :0.0180   Length:12          Min.   : 0.280  
##  1st Qu.: 4.500   1st Qu.:0.1875   Class :character   1st Qu.: 1.075  
##  Median : 6.050   Median :0.2555   Mode  :character   Median : 4.055  
##  Mean   : 6.808   Mean   :0.3362                      Mean   : 4.172  
##  3rd Qu.: 8.375   3rd Qu.:0.4300                      3rd Qu.: 5.832  
##  Max.   :13.400   Max.   :0.7960                      Max.   :12.850
mean(seedn$rainfall)
## [1] 4.171667
sd(seedn$rainfall)
## [1] 3.519196

The means and standard deviations are relatively close with more variability in the clouds with no seeding.

Boxplots of data

ggplot(seedy, aes(x=seeding, y=rainfall)) + geom_boxplot()

ggplot(seedn, aes(x=seeding, y=rainfall)) + geom_boxplot()

Based on the boxplots above, the medians are very close to eachother. We also see the affect of the deviation in the clouds that don’t have seeding vs. the clouds that are seeded and appear to have a much more controlled rainfall with one major outlier.

t.test

t.test(seedy$rainfall, seedn$rainfall, alternative = "two.sided")
## 
##  Welch Two Sample t-test
## 
## data:  seedy$rainfall and seedn$rainfall
## t = 0.3574, df = 20.871, p-value = 0.7244
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -2.229691  3.154691
## sample estimates:
## mean of x mean of y 
##  4.634167  4.171667

We have a signifcant P-Value that indicates the seeded and non-seeded rainfalls are very similar to eachother which is reflected in the closeness of the means and the similar spread to the boxplots

Linear Regression Model

cloudslm = lm(rainfall ~ seeding + cloudcover + prewetness +
                echomotion + sne, data = clouds)
cloudslm
## 
## Call:
## lm(formula = rainfall ~ seeding + cloudcover + prewetness + echomotion + 
##     sne, data = clouds)
## 
## Coefficients:
##          (Intercept)            seedingyes            cloudcover  
##              6.37680               1.12011               0.01821  
##           prewetness  echomotionstationary                   sne  
##              2.55109               2.59855              -1.27530
summary(cloudslm)
## 
## Call:
## lm(formula = rainfall ~ seeding + cloudcover + prewetness + echomotion + 
##     sne, data = clouds)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -5.1158 -1.7078 -0.2422  1.3368  6.4827 
## 
## Coefficients:
##                      Estimate Std. Error t value Pr(>|t|)  
## (Intercept)           6.37680    2.43432   2.620   0.0174 *
## seedingyes            1.12011    1.20725   0.928   0.3658  
## cloudcover            0.01821    0.11508   0.158   0.8761  
## prewetness            2.55109    2.70090   0.945   0.3574  
## echomotionstationary  2.59855    1.54090   1.686   0.1090  
## sne                  -1.27530    0.68015  -1.875   0.0771 .
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 2.855 on 18 degrees of freedom
## Multiple R-squared:  0.3403, Adjusted R-squared:  0.157 
## F-statistic: 1.857 on 5 and 18 DF,  p-value: 0.1524
anova(cloudslm)
## Analysis of Variance Table
## 
## Response: rainfall
##            Df  Sum Sq Mean Sq F value  Pr(>F)  
## seeding     1   1.283  1.2834  0.1575 0.69613  
## cloudcover  1  15.738 15.7377  1.9313 0.18157  
## prewetness  1   0.003  0.0027  0.0003 0.98557  
## echomotion  1  29.985 29.9853  3.6798 0.07108 .
## sne         1  28.649 28.6491  3.5158 0.07711 .
## Residuals  18 146.677  8.1487                  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Based on the F-Value we see that there are 3 potential impacts to rainfall: Cloud cover, echo motion, and suitability criterion (sne)

Creating LRM based in relation to sne based on seeding

cloudslmy = lm(rainfall ~ sne, data = seedy)
cloudslmy
## 
## Call:
## lm(formula = rainfall ~ sne, data = seedy)
## 
## Coefficients:
## (Intercept)          sne  
##      12.020       -2.218
summary(cloudslmy)
## 
## Call:
## lm(formula = rainfall ~ sne, data = seedy)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -3.0134 -1.3297 -0.3276  0.6171  4.3867 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)   
## (Intercept)  12.0202     2.9774   4.037  0.00237 **
## sne          -2.2180     0.8722  -2.543  0.02921 * 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 2.27 on 10 degrees of freedom
## Multiple R-squared:  0.3927, Adjusted R-squared:  0.332 
## F-statistic: 6.467 on 1 and 10 DF,  p-value: 0.02921
cloudslmn = lm(rainfall ~ sne, data = seedn)
cloudslmn
## 
## Call:
## lm(formula = rainfall ~ sne, data = seedn)
## 
## Coefficients:
## (Intercept)          sne  
##       7.319       -1.046
summary(cloudslmn)
## 
## Call:
## lm(formula = rainfall ~ sne, data = seedn)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -5.4892 -2.1762  0.2958  1.4902  7.3616 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)  
## (Intercept)    7.319      3.160   2.317    0.043 *
## sne           -1.046      0.995  -1.052    0.318  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 3.502 on 10 degrees of freedom
## Multiple R-squared:  0.09957,    Adjusted R-squared:  0.009528 
## F-statistic: 1.106 on 1 and 10 DF,  p-value: 0.3177

Plots of the models

x1 = ggplot(cloudslmy, aes(x = sne, y = rainfall)) + geom_point()
x1 = x1 + geom_abline(slope = coef(cloudslm)[4], intercept = coef(cloudslm)[6])
x2 = ggplot(cloudslmn, aes(x = sne, y = rainfall)) + geom_point()
x2 = x2 + geom_abline(slope = coef(cloudslm)[4], intercept = coef(cloudslm)[6])
x1

x2