#Mental Health in Urban Areas

Group 1: Ysabel Gamon, Khyle Capulong, Logan Salcido, Samantha Magana

We will be creating a multiple regression on our results from our survery on mental health in urban areas

# Read the CSV file
data <- read.csv("mktg4000.surveryresults.csv")
# Run multiple regression
model <- lm(data, data = data)
summary(model)
## 
## Call:
## lm(formula = data, data = data)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -0.68751 -0.31161 -0.01294  0.18297  1.07993 
## 
## Coefficients: (1 not defined because of singularities)
##                                 Estimate Std. Error t value Pr(>|t|)   
## (Intercept)                    -15.62586    4.80135  -3.254  0.01397 * 
## negative_feelings               -0.03643    0.26447  -0.138  0.89431   
## satisfaction_living_conditions  -0.67364    0.20727  -3.250  0.01406 * 
## frequency_noise_disturbances    -0.48769    0.38579  -1.264  0.24664   
## mental_resources                -0.28630    0.18343  -1.561  0.16253   
## safety                                NA         NA      NA       NA   
## city_anxiety                     4.98342    1.32816   3.752  0.00715 **
## support                         -0.21471    0.31831  -0.675  0.52163   
## personalization                  0.31746    0.44861   0.708  0.50204   
## device.access                    0.30950    0.49416   0.626  0.55097   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.6885 on 7 degrees of freedom
##   (1 observation deleted due to missingness)
## Multiple R-squared:  0.815,  Adjusted R-squared:  0.6036 
## F-statistic: 3.855 on 8 and 7 DF,  p-value: 0.04601
# Plot diagnostic graphs
par(mfrow = c(2, 2))
plot(model)
## Warning: not plotting observations with leverage one:
##   14

#Interpreting Results: R-squared: 0.815 Good Model Fit Adjusted R-Squared: 0.604 Strong model when accounting for multiple predictors P-Value: 0.046 Statistically significant overall model

#Significant Predictors: Satisfaction(living conditions): -0.674 p-value 0.014 indicates significant negative effect City Anxiety: 4.983 p-value: 0.007 indicating strong positive predictor of worse mental health

#Conclusion: Satisfaction with living conditions and city anxiety are signifacant predictors when it comes to mental health in urban areas.