Chi-square for IPVstatus and Sex
tbl = table(output_Abusew01Neupsyw03Neupsy$IPVstatus, output_Abusew01Neupsyw03Neupsy$Sex)
tbl
##
## Women Men
## 0 22 20
## 1 12 9
chisq.test(tbl)
##
## Pearson's Chi-squared test with Yates' continuity correction
##
## data: tbl
## X-squared = 0.008, df = 1, p-value = 0.9288
Chi-square for IPVstatus and Race
tbl2 = table(output_Abusew01Neupsyw03Neupsy$IPVstatus, output_Abusew01Neupsyw03Neupsy$Race)
tbl2
##
## White AfrAm
## 0 15 27
## 1 8 13
chisq.test(tbl2)
##
## Pearson's Chi-squared test with Yates' continuity correction
##
## data: tbl2
## X-squared = 0, df = 1, p-value = 1
Chi-square for Race and Sex
tbl3 = table(output_Abusew01Neupsyw03Neupsy$Sex, output_Abusew01Neupsyw03Neupsy$Race)
tbl3
##
## White AfrAm
## Women 12 22
## Men 11 18
chisq.test(tbl3)
##
## Pearson's Chi-squared test with Yates' continuity correction
##
## data: tbl3
## X-squared = 0, df = 1, p-value = 1
t-test for IPVgroup and Age
y = output_Abusew01Neupsyw03Neupsy$Age1
x = output_Abusew01Neupsyw03Neupsy$IPVstatus
t.test(y ~ x)
##
## Welch Two Sample t-test
##
## data: y by x
## t = -0.4857, df = 46.67, p-value = 0.6294
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
## -4.286 2.619
## sample estimates:
## mean in group 0 mean in group 1
## 40.12 40.95
t-test for IPVgroup and Years of Education
y = output_Abusew01Neupsyw03Neupsy$Education
x = output_Abusew01Neupsyw03Neupsy$IPVstatus
t.test(y ~ x)
##
## Welch Two Sample t-test
##
## data: y by x
## t = 0.6654, df = 41.8, p-value = 0.5095
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
## -1.210 2.401
## sample estimates:
## mean in group 0 mean in group 1
## 12.17 11.57