library(readxl)
Dog_Data_ACS <-read_excel("Dog Data Acs.xlsx")
dogdata <- Dog_Data_ACS[, !(names(Dog_Data_ACS) %in% "Species")]
spayneut<- c(dogdata$`Spay/Neuter`)
##linear model excluding species##
dogmodel <- lm(Euthanized ~ Intake + Adoptions + Fosters + spayneut, data = dogdata)
##summary of model##
summary(dogmodel)
##
## Call:
## lm(formula = Euthanized ~ Intake + Adoptions + Fosters + spayneut,
## data = dogdata)
##
## Residuals:
## Min 1Q Median 3Q Max
## -160.889 -35.781 -3.797 27.284 179.788
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -64.355661 72.907338 -0.883 0.382304
## Intake 0.160737 0.064641 2.487 0.016857 *
## Adoptions -0.317250 0.201648 -1.573 0.122983
## Fosters 1.391592 0.347050 4.010 0.000238 ***
## spayneut -0.007722 0.018909 -0.408 0.685040
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 70.69 on 43 degrees of freedom
## (9 observations deleted due to missingness)
## Multiple R-squared: 0.6248, Adjusted R-squared: 0.5899
## F-statistic: 17.9 on 4 and 43 DF, p-value: 1.013e-08
plot(dogmodel)




library(readxl)
Cat_Data_ACS <-read_excel("Cat Data ACS.xlsx")
catdata <- Cat_Data_ACS[, !(names(Cat_Data_ACS) %in% "Species")]
trapneut<- c(catdata$TNR)
##linear model excluding species##
catmodel <- lm(Euthanized ~ Intake + Adoptions + Fosters + trapneut, data = catdata)
##summary of model##
summary(catmodel)
##
## Call:
## lm(formula = Euthanized ~ Intake + Adoptions + Fosters + trapneut,
## data = catdata)
##
## Residuals:
## Min 1Q Median 3Q Max
## -42.071 -10.666 -3.502 11.969 41.860
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 8.09280 10.21962 0.792 0.43277
## Intake 0.08504 0.02179 3.903 0.00033 ***
## Adoptions 0.12342 0.07674 1.608 0.11510
## Fosters -0.05798 0.12728 -0.456 0.65104
## trapneut -0.05847 0.12215 -0.479 0.63461
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 18.35 on 43 degrees of freedom
## (9 observations deleted due to missingness)
## Multiple R-squared: 0.5191, Adjusted R-squared: 0.4744
## F-statistic: 11.61 on 4 and 43 DF, p-value: 1.771e-06
plot(catmodel)



