This is a brief exploration of Christiana Care HCAHPS scores using Chi Squared statistics. It looks at the relationship between various patient characteristics and the response to the question “Would you recommend this hospital?”

Data for the analysis that follows came from HCAHPS survey results received between 10/1/2015 and 12/31/2015.

## Set working directory.
setwd('/Users/mitchellfawcett/Documents/Data Science Projects/Patient Satisfaction')

1. Gender

Contingency table:

##         ResponseDesc
## GenderID Definitely no Definitely yes Probably no Probably yes
##   Male              11            516           8           98
##   Female            13            729          24          176

Proportions:

##         ResponseDesc
## GenderID Definitely no Definitely yes Probably no Probably yes
##   Male           0.007          0.328       0.005        0.062
##   Female         0.008          0.463       0.015        0.112

Chi Squared and p value:

## Number of cases in table: 1575 
## Number of factors: 2 
## Test for independence of all factors:
##  Chisq = 6.437, df = 3, p-value = 0.09218

2a. Marital Status, all marital statuses

Contingency table:

##              ResponseDesc
## MaritalStatus Definitely no Definitely yes Probably no Probably yes
##            D              1            101           1           22
##            M             11            821          14          159
##            P              0              1           1            1
##            S              7            148           8           43
##            U              0              2           0            2
##            W              5            161           8           43
##            X              0             11           0            4

Proportions:

##              ResponseDesc
## MaritalStatus Definitely no Definitely yes Probably no Probably yes
##            D          0.001          0.064       0.001        0.014
##            M          0.007          0.521       0.009        0.101
##            P          0.000          0.001       0.001        0.001
##            S          0.004          0.094       0.005        0.027
##            U          0.000          0.001       0.000        0.001
##            W          0.003          0.102       0.005        0.027
##            X          0.000          0.007       0.000        0.003

Chi Squared and p value:

## Number of cases in table: 1575 
## Number of factors: 2 
## Test for independence of all factors:
##  Chisq = 43.24, df = 18, p-value = 0.0007393
##  Chi-squared approximation may be incorrect

2b. Marital Status, married/other

Contingency table:

##              ResponseDesc
## MaritalStatus Definitely no Definitely yes Probably no Probably yes
##            OT            13            424          18          115
##            M             11            821          14          159

Proportions:

##              ResponseDesc
## MaritalStatus Definitely no Definitely yes Probably no Probably yes
##            OT         0.008          0.269       0.011        0.073
##            M          0.007          0.521       0.009        0.101

Chi Squared and p value:

## Number of cases in table: 1575 
## Number of factors: 2 
## Test for independence of all factors:
##  Chisq = 15.354, df = 3, p-value = 0.001538

3a. Race, all races

Contingency table:

##         ResponseDesc
## RaceCode Definitely no Definitely yes Probably no Probably yes
##       AS             0             22           0            5
##       BL             3            144           1           37
##       DE             0              1           0            1
##       OT             0             12           0            1
##       PI             0              3           0            0
##       U              0              1           0            1
##       WH            21           1062          31          229

Proportions:

##         ResponseDesc
## RaceCode Definitely no Definitely yes Probably no Probably yes
##       AS         0.000          0.014       0.000        0.003
##       BL         0.002          0.091       0.001        0.023
##       DE         0.000          0.001       0.000        0.001
##       OT         0.000          0.008       0.000        0.001
##       PI         0.000          0.002       0.000        0.000
##       U          0.000          0.001       0.000        0.001
##       WH         0.013          0.674       0.020        0.145

Chi Squared and p value:

## Number of cases in table: 1575 
## Number of factors: 2 
## Test for independence of all factors:
##  Chisq = 9.666, df = 18, p-value = 0.9423
##  Chi-squared approximation may be incorrect

3b. Race, white/other

Contingency table:

##         ResponseDesc
## RaceCode Definitely no Definitely yes Probably no Probably yes
##       OT             3            183           1           45
##       WH            21           1062          31          229

Proportions:

##         ResponseDesc
## RaceCode Definitely no Definitely yes Probably no Probably yes
##       OT         0.002          0.116       0.001        0.029
##       WH         0.013          0.674       0.020        0.145

Chi Squared and p value:

## Number of cases in table: 1575 
## Number of factors: 2 
## Test for independence of all factors:
##  Chisq = 4.153, df = 3, p-value = 0.2454
##  Chi-squared approximation may be incorrect