Creating variable in background
Creating variable in background
Creating index variables for independent variables based on factor analysis.
HR challenge index: Managerial competence, technical capabilities, manpower and hiring
FT challenge index: Financing operations and maintenance, financing infrastructure, maintaining high water quality, complying with regulations
HR challenge skewed
FT challenge skewed, but not as bad
I just did this as a starting point for the dependent variable, below I try out a “straight scale” (adding up complete cases). This takes into account incomplete so if someone answered 2 out of 9 their average is taken out of 2.
Very skewed distribution, lots of zeros.
Median income looks a little more normal to me than percent poverty, and so I try out percent poverty but use median income in most models below. I need to think through implications of one variable over another.
#Regression table with poverty prevalence
##Looking at EPA region
## Region 1 Region 10 Region 2 Region 3 Region 4 Region 5 Region 6 Region 7
## 470 480 229 541 688 929 633 633
## Region 8 Region 9
## 464 552
#Regression Table models 1, 2 and 3
| Dependent variable: | |||
| Benefit Index | |||
| Model 2 Median Income | Model 3 Median Income and EPA Region | ||
| (1) | (2) | (3) | |
| HR_Chal_Index | 0.31*** | 0.31*** | 0.31*** |
| (0.02) | (0.02) | (0.02) | |
| Fin_Tech_Chal_Index | 0.24*** | 0.24*** | 0.24*** |
| (0.02) | (0.02) | (0.02) | |
| Challenge_Customer | 0.07*** | 0.07*** | 0.07*** |
| (0.02) | (0.02) | (0.02) | |
| grouped_owner1Privately Owned | -0.01 | -0.02 | -0.05 |
| (0.04) | (0.04) | (0.04) | |
| grouped_owner1Community Owned | -0.01 | -0.03 | -0.05 |
| (0.04) | (0.04) | (0.04) | |
| grouped_owner1Other | -0.05 | -0.06 | -0.09 |
| (0.09) | (0.09) | (0.09) | |
| grouped_water_sourcePurchased | 0.18*** | 0.18*** | 0.20*** |
| (0.04) | (0.04) | (0.04) | |
| grouped_water_sourceSurface water | 0.02 | 0.04 | 0.03 |
| (0.05) | (0.05) | (0.06) | |
| percent_below_poverty_level | 0.0004 | ||
| (0.002) | |||
| median_income | 0.0000*** | 0.0000** | |
| (0.0000) | (0.0000) | ||
| Population_Served_Count | -0.0000*** | -0.0000*** | -0.0000*** |
| (0.0000) | (0.0000) | (0.0000) | |
| NEAR_DIST | -0.0000* | -0.0000* | -0.0000+ |
| (0.0000) | (0.0000) | (0.0000) | |
| EPA_RegionRegion 10 | -0.15* | ||
| (0.07) | |||
| EPA_RegionRegion 2 | -0.04 | ||
| (0.08) | |||
| EPA_RegionRegion 3 | -0.19** | ||
| (0.06) | |||
| EPA_RegionRegion 4 | -0.11+ | ||
| (0.06) | |||
| EPA_RegionRegion 5 | -0.21*** | ||
| (0.06) | |||
| EPA_RegionRegion 6 | -0.20** | ||
| (0.06) | |||
| EPA_RegionRegion 7 | -0.24*** | ||
| (0.06) | |||
| EPA_RegionRegion 8 | -0.20** | ||
| (0.07) | |||
| EPA_RegionRegion 9 | -0.15* | ||
| (0.06) | |||
| Constant | 0.38*** | 0.26*** | 0.45*** |
| (0.04) | (0.05) | (0.08) | |
| Observations | 4,179 | 4,171 | 4,171 |
| Adjusted R2 | 0.29 | 0.29 | 0.29 |
| Note: | (+ p<0.1; * p<0.05; ** p<0.01; *** p<0.001) | ||
Pattern in the residuals which is expected with a limited dependent variable. May need to think about other models, but using these results to just get started
##
## Asymptotic one-sample Kolmogorov-Smirnov test
##
## data: rz_full_1
## D = 0.07, p-value <0.0000000000000002
## alternative hypothesis: two-sided
## GVIF Df GVIF^(1/(2*Df))
## HR_Chal_Index 1.6 1 1.3
## Fin_Tech_Chal_Index 1.7 1 1.3
## Challenge_Customer 1.4 1 1.2
## grouped_owner1 1.4 3 1.1
## grouped_water_source 1.2 2 1.0
## median_income 1.1 1 1.0
## Population_Served_Count 1.3 1 1.1
## NEAR_DIST 1.1 1 1.1
##
## Asymptotic one-sample Kolmogorov-Smirnov test
##
## data: rz_full_2
## D = 0.07, p-value <0.0000000000000002
## alternative hypothesis: two-sided
## GVIF Df GVIF^(1/(2*Df))
## HR_Chal_Index 1.6 1 1.3
## Fin_Tech_Chal_Index 1.7 1 1.3
## Challenge_Customer 1.4 1 1.2
## grouped_owner1 1.5 3 1.1
## grouped_water_source 1.2 2 1.1
## median_income 1.2 1 1.1
## Population_Served_Count 1.3 1 1.1
## NEAR_DIST 1.2 1 1.1
## EPA_Region 1.5 9 1.0
##
## Asymptotic one-sample Kolmogorov-Smirnov test
##
## data: rz_full_3
## D = 0.07, p-value <0.0000000000000002
## alternative hypothesis: two-sided
I think classification trees make more sense with the likert-scale data, but many of the classification trees did not split. Which means there was no way to split the data to improve “predication” of each class. I assume because there are so many zeros (see histograms) there’s no way to split the data that improves prediction more than just guessing 0. Even the classification trees that do split, there’s a decent amount of ‘impurity’ in the leaves.
Because many of the classification trees didn’t split, I also just ran regression trees for everything too. Just to see. Not surprisingly, very difficult to understand systems that see high benefits, often the highest average for a leaf is 2.5.
To classify cases by the level of different operational benefits,
most trees use the “corresponding” challenge to split the data set. With
higher levels of the corresponding challenge leading to leaves with
higher perception of benefits. Some trees have interactions with
challenges, and a couple have other “control” variables in the split.
## Regression tree water supply benefit
Just tried an additive scale here (complete cases only), to see if more variation
## Min. 1st Qu. Median Mean 3rd Qu. Max. NA's
## 0.0 3.0 9.0 10.6 17.0 36.0 1437
##
## Call:
## lm(formula = partnership_ben_add_index ~ HR_Chal_Index + Fin_Tech_Chal_Index +
## Challenge_Customer + grouped_owner1 + grouped_water_source +
## median_income + Population_Served_Count + NEAR_DIST + EPA_Region,
## data = dat)
##
## Residuals:
## Min 1Q Median 3Q Max
## -26.47 -4.80 -1.12 4.24 32.78
##
## Coefficients:
## Estimate Std. Error t value
## (Intercept) 3.57989821 0.68178526 5.25
## HR_Chal_Index 2.73849623 0.14546786 18.83
## Fin_Tech_Chal_Index 2.23867815 0.15923739 14.06
## Challenge_Customer 0.66240863 0.15174598 4.37
## grouped_owner1Privately Owned -0.26455520 0.36635499 -0.72
## grouped_owner1Community Owned -0.44847008 0.34376745 -1.30
## grouped_owner1Other -0.77880405 0.81655229 -0.95
## grouped_water_sourcePurchased 1.65137006 0.34485988 4.79
## grouped_water_sourceSurface water 0.33259036 0.49945253 0.67
## median_income 0.00001447 0.00000533 2.71
## Population_Served_Count -0.00039553 0.00007029 -5.63
## NEAR_DIST -0.00004158 0.00002296 -1.81
## EPA_RegionRegion 10 -1.00104757 0.59649622 -1.68
## EPA_RegionRegion 2 -0.28201234 0.76314870 -0.37
## EPA_RegionRegion 3 -1.36018989 0.58625521 -2.32
## EPA_RegionRegion 4 -0.88854617 0.58130321 -1.53
## EPA_RegionRegion 5 -1.56802875 0.52846250 -2.97
## EPA_RegionRegion 6 -1.41372603 0.57746831 -2.45
## EPA_RegionRegion 7 -1.78928678 0.56812747 -3.15
## EPA_RegionRegion 8 -1.50306767 0.61240780 -2.45
## EPA_RegionRegion 9 -0.95907379 0.57329217 -1.67
## Pr(>|t|)
## (Intercept) 0.00000016 ***
## HR_Chal_Index < 0.0000000000000002 ***
## Fin_Tech_Chal_Index < 0.0000000000000002 ***
## Challenge_Customer 0.00001303 ***
## grouped_owner1Privately Owned 0.4703
## grouped_owner1Community Owned 0.1921
## grouped_owner1Other 0.3403
## grouped_water_sourcePurchased 0.00000174 ***
## grouped_water_sourceSurface water 0.5055
## median_income 0.0067 **
## Population_Served_Count 0.00000002 ***
## NEAR_DIST 0.0702 .
## EPA_RegionRegion 10 0.0934 .
## EPA_RegionRegion 2 0.7117
## EPA_RegionRegion 3 0.0204 *
## EPA_RegionRegion 4 0.1265
## EPA_RegionRegion 5 0.0030 **
## EPA_RegionRegion 6 0.0144 *
## EPA_RegionRegion 7 0.0016 **
## EPA_RegionRegion 8 0.0142 *
## EPA_RegionRegion 9 0.0944 .
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 7.6 on 3904 degrees of freedom
## (1694 observations deleted due to missingness)
## Multiple R-squared: 0.304, Adjusted R-squared: 0.3
## F-statistic: 85.3 on 20 and 3904 DF, p-value: <0.0000000000000002
## GVIF Df GVIF^(1/(2*Df))
## HR_Chal_Index 1.6 1 1.3
## Fin_Tech_Chal_Index 1.7 1 1.3
## Challenge_Customer 1.4 1 1.2
## grouped_owner1 1.5 3 1.1
## grouped_water_source 1.2 2 1.1
## median_income 1.2 1 1.1
## Population_Served_Count 1.3 1 1.1
## NEAR_DIST 1.2 1 1.1
## EPA_Region 1.5 9 1.0
##
## Asymptotic one-sample Kolmogorov-Smirnov test
##
## data: rz_full_4
## D = 0.06, p-value = 0.000000000000009
## alternative hypothesis: two-sided
Just trying out a tree to see what mechanisms group suppliers into high or low perception of benefits in general.
Added concerns to just see
All splits are challenges, no split based on “control” variables or ownership.
| Dependent variable: | ||||||
| Level of Benefit for Each Parntership Type | Type_of_Partnership_Beneficial_Joint | Type_of_Partnership_Beneficial_Shared_Staff_LT | Type_of_Partnership_Beneficial_Contracting_LT | Type_of_Partnership_Beneficial_Contracting_ST | Type_of_Partnership_Beneficial_Informal | |
| Consolidation | Joint Powers | Shared Staff | LT Contracting | ST Contracting | Informal | |
| (1) | (2) | (3) | (4) | (5) | (6) | |
| Constant | 0.09 | 0.06 | 0.41*** | 0.50*** | 0.47*** | 0.66*** |
| (0.09) | (0.07) | (0.10) | (0.12) | (0.11) | (0.12) | |
| HRChallenge_Managerial_Competence | 0.06** | 0.06*** | 0.05* | 0.07* | 0.04 | 0.01 |
| (0.02) | (0.02) | (0.02) | (0.03) | (0.03) | (0.03) | |
| HRChallenge_Technical_Capabilities | 0.05* | 0.03+ | 0.06** | 0.08* | 0.10*** | 0.13*** |
| (0.02) | (0.02) | (0.02) | (0.03) | (0.03) | (0.03) | |
| HRChallenge_Manpower | 0.09*** | 0.04** | 0.12*** | 0.07** | 0.08*** | 0.12*** |
| (0.02) | (0.02) | (0.02) | (0.03) | (0.02) | (0.02) | |
| HRChallenge_Hiring | -0.01 | -0.001 | 0.11*** | 0.07*** | 0.08*** | 0.08*** |
| (0.02) | (0.01) | (0.02) | (0.02) | (0.02) | (0.02) | |
| Challenge_Regulations | 0.03 | 0.01 | 0.03+ | 0.02 | 0.03 | 0.05* |
| (0.02) | (0.01) | (0.02) | (0.02) | (0.02) | (0.02) | |
| Challenge_Customer | 0.07*** | 0.04* | 0.04* | 0.03 | 0.04 | 0.05+ |
| (0.02) | (0.02) | (0.02) | (0.03) | (0.03) | (0.03) | |
| Challenge_Water_Quality | 0.08*** | 0.04** | 0.02 | 0.07** | 0.02 | 0.01 |
| (0.02) | (0.02) | (0.02) | (0.03) | (0.02) | (0.02) | |
| grouped_owner1Privately Owned | 0.16** | 0.10** | -0.04 | 0.08 | -0.04 | -0.07 |
| (0.05) | (0.04) | (0.05) | (0.07) | (0.06) | (0.06) | |
| grouped_owner1Community Owned | 0.10* | 0.02 | -0.03 | 0.04 | -0.02 | -0.04 |
| (0.05) | (0.04) | (0.05) | (0.06) | (0.06) | (0.06) | |
| grouped_owner1Other | 0.10 | 0.15+ | -0.13 | 0.21 | 0.002 | -0.17 |
| (0.11) | (0.09) | (0.12) | (0.15) | (0.14) | (0.14) | |
| grouped_water_sourcePurchased | 0.37*** | 0.22*** | 0.18*** | 0.31*** | 0.05 | 0.17** |
| (0.05) | (0.04) | (0.05) | (0.06) | (0.06) | (0.06) | |
| grouped_water_sourceSurface water | 0.16* | 0.03 | 0.10 | 0.12 | 0.11 | 0.24** |
| (0.07) | (0.05) | (0.07) | (0.09) | (0.08) | (0.09) | |
| median_income | 0.0000 | 0.0000 | -0.0000 | 0.0000*** | 0.0000*** | 0.0000 |
| (0.0000) | (0.0000) | (0.0000) | (0.0000) | (0.0000) | (0.0000) | |
| Population_Served_Count | -0.0000*** | -0.0000* | -0.0001*** | -0.0001*** | -0.0000* | -0.0000** |
| (0.0000) | (0.0000) | (0.0000) | (0.0000) | (0.0000) | (0.0000) | |
| NEAR_DIST | -0.0000** | -0.0000* | -0.0000* | -0.0000** | -0.0000* | -0.0000 |
| (0.0000) | (0.0000) | (0.0000) | (0.0000) | (0.0000) | (0.0000) | |
| EPA_RegionRegion 10 | -0.05 | -0.03 | -0.14 | -0.06 | 0.01 | 0.08 |
| (0.08) | (0.06) | (0.08) | (0.11) | (0.10) | (0.10) | |
| EPA_RegionRegion 2 | 0.004 | 0.01 | 0.04 | -0.16 | -0.05 | 0.15 |
| (0.10) | (0.08) | (0.11) | (0.14) | (0.13) | (0.13) | |
| EPA_RegionRegion 3 | 0.06 | -0.04 | -0.04 | -0.14 | -0.20* | -0.12 |
| (0.08) | (0.06) | (0.08) | (0.11) | (0.10) | (0.10) | |
| EPA_RegionRegion 4 | -0.02 | -0.09 | -0.19* | 0.04 | 0.01 | -0.03 |
| (0.08) | (0.06) | (0.08) | (0.11) | (0.10) | (0.10) | |
| EPA_RegionRegion 5 | -0.09 | -0.05 | -0.07 | -0.13 | -0.13 | -0.05 |
| (0.07) | (0.06) | (0.07) | (0.10) | (0.09) | (0.09) | |
| EPA_RegionRegion 6 | -0.03 | -0.11+ | -0.19* | -0.18+ | -0.11 | -0.15 |
| (0.08) | (0.06) | (0.08) | (0.10) | (0.10) | (0.10) | |
| EPA_RegionRegion 7 | -0.08 | -0.11+ | -0.11 | -0.21* | -0.24* | -0.07 |
| (0.08) | (0.06) | (0.08) | (0.10) | (0.09) | (0.10) | |
| EPA_RegionRegion 8 | -0.10 | -0.02 | -0.02 | -0.09 | -0.06 | -0.13 |
| (0.08) | (0.07) | (0.09) | (0.11) | (0.10) | (0.11) | |
| EPA_RegionRegion 9 | 0.13+ | 0.02 | -0.06 | 0.02 | -0.13 | 0.05 |
| (0.08) | (0.06) | (0.08) | (0.10) | (0.09) | (0.10) | |
| Observations | 3,937 | 3,876 | 3,882 | 3,902 | 3,875 | 3,864 |
| Adjusted R2 | 0.10 | 0.06 | 0.14 | 0.08 | 0.09 | 0.10 |
| Note: | (+ p<0.1; * p<0.05; ** p<0.01; *** p<0.001) | |||||