Descriptive Statistics Load epiDisplay package for the tab1 function. Gender
tab1(BIL$Gender, graph = FALSE)
BIL$Gender :
Frequency Percent Cum. percent
1 305 53.9 53.9
2 261 46.1 100.0
Total 566 100.0 100.0
tab1(BIL$GenderCategorical, graph = FALSE)
BIL$GenderCategorical :
Frequency Percent Cum. percent
Female 305 53.9 53.9
Male 261 46.1 100.0
Total 566 100.0 100.0
tab1(BIL$EducationCategorical, graph = FALSE)
BIL$EducationCategorical :
Frequency %(NA+) %(NA-)
Bachelors 192 33.9 34.0
Doctorate 26 4.6 4.6
HighSchool 96 17.0 17.0
LessHighSchool 6 1.1 1.1
Masters 97 17.1 17.2
SomeCollege 147 26.0 26.1
<NA> 2 0.4 0.0
Total 566 100.0 100.0
Race
tab1(BIL$Race, graph = FALSE)
BIL$Race :
Frequency Percent Cum. percent
1 383 67.7 67.7
2 113 20.0 87.6
4 55 9.7 97.3
5 2 0.4 97.7
6 4 0.7 98.4
7 9 1.6 100.0
Total 566 100.0 100.0
tab1(BIL$RaceCategorical, graph = FALSE)
BIL$RaceCategorical :
Frequency Percent Cum. percent
Asian 55 9.7 9.7
BlackorAfricanAmerican 113 20.0 29.7
NativeAmericanAlaskan 2 0.4 30.0
NativeHawaiianPacificIslander 4 0.7 30.7
Other 9 1.6 32.3
White 383 67.7 100.0
Total 566 100.0 100.0
Ethnicity
tab1(BIL$Ethnicity, graph = FALSE)
BIL$Ethnicity :
Frequency Percent Cum. percent
2 66 11.7 11.7
3 500 88.3 100.0
Total 566 100.0 100.0
tab1(BIL$EthnicityCategorical, graph = FALSE)
BIL$EthnicityCategorical :
Frequency Percent Cum. percent
Hispanic 66 11.7 11.7
nonHispanic 500 88.3 100.0
Total 566 100.0 100.0
Education Level
tab1(BIL$Educ, graph = FALSE)
BIL$Educ :
Frequency %(NA+) %(NA-)
1 6 1.1 1.1
2 96 17.0 17.1
3 147 26.0 26.1
4 192 33.9 34.1
5 97 17.1 17.2
6 25 4.4 4.4
<NA> 3 0.5 0.0
Total 566 100.0 100.0
tab1(BIL$EducationCategorical, graph = FALSE)
BIL$EducationCategorical :
Frequency %(NA+) %(NA-)
Bachelors 192 33.9 34.0
Doctorate 26 4.6 4.6
HighSchool 96 17.0 17.0
LessHighSchool 6 1.1 1.1
Masters 97 17.1 17.2
SomeCollege 147 26.0 26.1
<NA> 2 0.4 0.0
Total 566 100.0 100.0
Marital Status
tab1(BIL$Marital, graph = FALSE)
BIL$Marital :
Frequency %(NA+) %(NA-)
1 353 62.4 62.7
2 206 36.4 36.6
8 4 0.7 0.7
<NA> 3 0.5 0.0
Total 566 100.0 100.0
tab1(BIL$MarriedCategorical, graph = FALSE)
BIL$MarriedCategorical :
Frequency %(NA+) %(NA-)
Married 353 62.4 63.1
NotMarried 206 36.4 36.9
<NA> 7 1.2 0.0
Total 566 100.0 100.0
Utah Residental Status
tab1(BIL$Utah, graph = FALSE)
BIL$Utah :
Frequency Percent Cum. percent
0 361 63.8 63.8
1 205 36.2 100.0
Total 566 100.0 100.0
mean(BIL$Income_1, na.rm=TRUE)
[1] 101.7744227
sd(BIL$Income_1, na.rm=TRUE)
[1] 93.70556932
Female/Male (Gender) Utah/NotUtah (Utah) White/nonWhite (White)
Differences Female/Male Intrinsic Rewards (Gender)
Interesting Job (JobCharacteristics_4)
#mean of whole sample
mean(BIL$JobCharacteristics_4, na.rm=TRUE)
[1] 3.828318584
#standard deviation of whole sample
sd(BIL$JobCharacteristics_4, na.rm=TRUE)
[1] 1.017878219
#differences of means test
t.test(BIL$JobCharacteristics_4~BIL$GenderCategorical, mu = 0, alternative = "two.sided")
Welch Two Sample t-test
data: BIL$JobCharacteristics_4 by BIL$GenderCategorical
t = -1.6623111, df = 562.91732, p-value = 0.0970071
alternative hypothesis: true difference in means between group Female and group Male is not equal to 0
95 percent confidence interval:
-0.30772924701 0.02561591771
sample estimates:
mean in group Female mean in group Male
3.763157895 3.904214559
#standard deviation for Male and Female subsets
tapply(BIL$JobCharacteristics_4, BIL$GenderCategorical, sd, na.rm=TRUE)
Female Male
1.0792788333 0.9376840619
#differences of variation test
var.test(BIL$JobCharacteristics_4~BIL$GenderCategorical, ratio = 1, alternative = "two.sided")
F test to compare two variances
data: BIL$JobCharacteristics_4 by BIL$GenderCategorical
F = 1.324812, num df = 303, denom df = 260, p-value = 0.01952362
alternative hypothesis: true ratio of variances is not equal to 1
95 percent confidence interval:
1.046450563 1.673645251
sample estimates:
ratio of variances
1.324811994
Job autonomy (JobCharacteristics_5)
#mean of whole sample
mean(BIL$JobCharacteristics_5, na.rm=TRUE)
[1] 4.056637168
#standard deviation of whole sample
sd(BIL$JobCharacteristics_5, na.rm=TRUE)
[1] 0.9912629048
#differences of means test
t.test(BIL$JobCharacteristics_5~BIL$GenderCategorical, mu = 0, alternative = "two.sided")
Welch Two Sample t-test
data: BIL$JobCharacteristics_5 by BIL$GenderCategorical
t = -0.36120518, df = 560.70903, p-value = 0.7180821
alternative hypothesis: true difference in means between group Female and group Male is not equal to 0
95 percent confidence interval:
-0.1933549651 0.1332874112
sample estimates:
mean in group Female mean in group Male
4.042763158 4.072796935
#standard deviation for Male and Female subsets
tapply(BIL$JobCharacteristics_5, BIL$GenderCategorical, sd, na.rm=TRUE)
Female Male
1.031587067 0.943840066
#differences of variation test
var.test(BIL$JobCharacteristics_5~BIL$GenderCategorical, ratio = 1, alternative = "two.sided")
F test to compare two variances
data: BIL$JobCharacteristics_5 by BIL$GenderCategorical
F = 1.1945792, num df = 303, denom df = 260, p-value = 0.1392822
alternative hypothesis: true ratio of variances is not equal to 1
95 percent confidence interval:
0.9435815154 1.5091211924
sample estimates:
ratio of variances
1.19457923
Help Others (JobCharacteristics_6)
#mean of whole sample
mean(BIL$JobCharacteristics_6, na.rm=TRUE)
[1] 4.148672566
#standard deviation of whole sample
sd(BIL$JobCharacteristics_6, na.rm=TRUE)
[1] 0.8624469399
#differences of means test
t.test(BIL$JobCharacteristics_6~BIL$GenderCategorical, mu = 0, alternative = "two.sided")
Welch Two Sample t-test
data: BIL$JobCharacteristics_6 by BIL$GenderCategorical
t = 0.9625554, df = 556.69486, p-value = 0.3361886
alternative hypothesis: true difference in means between group Female and group Male is not equal to 0
95 percent confidence interval:
-0.07264740934 0.21226729239
sample estimates:
mean in group Female mean in group Male
4.180921053 4.111111111
#standard deviation for Male and Female subsets
tapply(BIL$JobCharacteristics_6, BIL$GenderCategorical, sd, na.rm=TRUE)
Female Male
0.8807612633 0.8407363480
#differences of variation test
var.test(BIL$JobCharacteristics_6~BIL$GenderCategorical, ratio = 1, alternative = "two.sided")
F test to compare two variances
data: BIL$JobCharacteristics_6 by BIL$GenderCategorical
F = 1.0974804, num df = 303, denom df = 260, p-value = 0.4393785
alternative hypothesis: true ratio of variances is not equal to 1
95 percent confidence interval:
0.8668844818 1.3864554588
sample estimates:
ratio of variances
1.097480377
Job useful to society (JobCharacteristics_7)
#mean of whole sample
mean(BIL$JobCharacteristics_7, na.rm=TRUE)
[1] 4.008849558
#standard deviation of whole sample
sd(BIL$JobCharacteristics_7, na.rm=TRUE)
[1] 0.9829718222
#differences of means test
t.test(BIL$JobCharacteristics_7~BIL$GenderCategorical, mu = 0, alternative = "two.sided")
Welch Two Sample t-test
data: BIL$JobCharacteristics_7 by BIL$GenderCategorical
t = 1.2260845, df = 544.566, p-value = 0.2206968
alternative hypothesis: true difference in means between group Female and group Male is not equal to 0
95 percent confidence interval:
-0.06135447573 0.26515060398
sample estimates:
mean in group Female mean in group Male
4.055921053 3.954022989
#standard deviation for Male and Female subsets
tapply(BIL$JobCharacteristics_7, BIL$GenderCategorical, sd, na.rm=TRUE)
Female Male
0.9682234115 0.9989384286
#differences of variation test
var.test(BIL$JobCharacteristics_7~BIL$GenderCategorical, ratio = 1, alternative = "two.sided")
F test to compare two variances
data: BIL$JobCharacteristics_7 by BIL$GenderCategorical
F = 0.9394501, num df = 303, denom df = 260, p-value = 0.5993029
alternative hypothesis: true ratio of variances is not equal to 1
95 percent confidence interval:
0.7420585668 1.1868145899
sample estimates:
ratio of variances
0.9394501027
Job satisfaction (JobSat)
#mean of whole sample
mean(BIL$JobSat, na.rm=TRUE)
[1] 7.44765282
#standard deviation of whole sample
sd(BIL$JobSat, na.rm=TRUE)
[1] 2.313424047
#differences of means test
t.test(BIL$JobSat~BIL$GenderCategorical, mu = 0, alternative = "two.sided")
Welch Two Sample t-test
data: BIL$JobSat by BIL$GenderCategorical
t = -2.4132826, df = 561.7524, p-value = 0.01612859
alternative hypothesis: true difference in means between group Female and group Male is not equal to 0
95 percent confidence interval:
-0.84358249853 -0.08654335478
sample estimates:
mean in group Female mean in group Male
7.232437529 7.697500456
#standard deviation for Male and Female subsets
tapply(BIL$JobSat, BIL$GenderCategorical, sd, na.rm=TRUE)
Female Male
2.434940916 2.141415003
#differences of variation test
var.test(BIL$JobSat~BIL$GenderCategorical, ratio = 1, alternative = "two.sided")
F test to compare two variances
data: BIL$JobSat by BIL$GenderCategorical
F = 1.2929305, num df = 302, denom df = 260, p-value = 0.03295216
alternative hypothesis: true ratio of variances is not equal to 1
95 percent confidence interval:
1.021105675 1.633698167
sample estimates:
ratio of variances
1.292930477
Differences / Extrinsic Rewards ()
Income in $1000’s (Income_1)
#mean of whole sample
mean(BIL$Income_1, na.rm=TRUE)
[1] 101.7744227
#standard deviation of whole sample
sd(BIL$Income_1, na.rm=TRUE)
[1] 93.70556932
#differences of means test
t.test(BIL$Income_1~BIL$GenderCategorical, mu = 0, alternative = "two.sided")
Welch Two Sample t-test
data: BIL$Income_1 by BIL$GenderCategorical
t = -4.1149568, df = 502.36296, p-value = 0.00004525397
alternative hypothesis: true difference in means between group Female and group Male is not equal to 0
95 percent confidence interval:
-48.15187233 -17.03041181
sample estimates:
mean in group Female mean in group Male
86.66556291 119.25670498
#standard deviation for Male and Female subsets
tapply(BIL$Income_1, BIL$GenderCategorical, sd, na.rm=TRUE)
Female Male
83.28798101 101.86831244
#differences of variation test
var.test(BIL$Income_1~BIL$GenderCategorical, ratio = 1, alternative = "two.sided")
F test to compare two variances
data: BIL$Income_1 by BIL$GenderCategorical
F = 0.66847696, num df = 301, denom df = 260, p-value = 0.0007551083
alternative hypothesis: true ratio of variances is not equal to 1
95 percent confidence interval:
0.5278525399 0.8448334629
sample estimates:
ratio of variances
0.6684769635
Perception of Income (JobCharacteristics_2)
#mean of whole sample
mean(BIL$JobCharacteristics_2, na.rm=TRUE)
[1] 3.007079646
#standard deviation of whole sample
sd(BIL$JobCharacteristics_2, na.rm=TRUE)
[1] 1.181995309
#differences of means test
t.test(BIL$JobCharacteristics_2~BIL$GenderCategorical, mu = 0, alternative = "two.sided")
Welch Two Sample t-test
data: BIL$JobCharacteristics_2 by BIL$GenderCategorical
t = -3.7817585, df = 557.42718, p-value = 0.0001725461
alternative hypothesis: true difference in means between group Female and group Male is not equal to 0
95 percent confidence interval:
-0.5642583125 -0.1784821593
sample estimates:
mean in group Female mean in group Male
2.835526316 3.206896552
#standard deviation for Male and Female subsets
tapply(BIL$JobCharacteristics_2, BIL$GenderCategorical, sd, na.rm=TRUE)
Female Male
1.196496971 1.134812059
#differences of variation test
var.test(BIL$JobCharacteristics_2~BIL$GenderCategorical, ratio = 1, alternative = "two.sided")
F test to compare two variances
data: BIL$JobCharacteristics_2 by BIL$GenderCategorical
F = 1.1116686, num df = 303, denom df = 260, p-value = 0.378722
alternative hypothesis: true ratio of variances is not equal to 1
95 percent confidence interval:
0.8780915306 1.4043795010
sample estimates:
ratio of variances
1.11166856
Job security (JobCharacteristics_1)
#mean of whole sample
mean(BIL$JobCharacteristics_1, na.rm=TRUE)
[1] 3.994690265
#standard deviation of whole sample
sd(BIL$JobCharacteristics_1, na.rm=TRUE)
[1] 0.9592624889
#differences of means test
t.test(BIL$JobCharacteristics_1~BIL$GenderCategorical, mu = 0, alternative = "two.sided")
Welch Two Sample t-test
data: BIL$JobCharacteristics_1 by BIL$GenderCategorical
t = -1.4526214, df = 560.71367, p-value = 0.1468883
alternative hypothesis: true difference in means between group Female and group Male is not equal to 0
95 percent confidence interval:
-0.27445643003 0.04109284866
sample estimates:
mean in group Female mean in group Male
3.940789474 4.057471264
#standard deviation for Male and Female subsets
tapply(BIL$JobCharacteristics_1, BIL$GenderCategorical, sd, na.rm=TRUE)
Female Male
0.9965852763 0.9117564010
#differences of variation test
var.test(BIL$JobCharacteristics_1~BIL$GenderCategorical, ratio = 1, alternative = "two.sided")
F test to compare two variances
data: BIL$JobCharacteristics_1 by BIL$GenderCategorical
F = 1.1947342, num df = 303, denom df = 260, p-value = 0.1389944
alternative hypothesis: true ratio of variances is not equal to 1
95 percent confidence interval:
0.9437039138 1.5093169509
sample estimates:
ratio of variances
1.194734187
Promotional opportunities (JobCharacteristics_3)
#mean of whole sample
mean(BIL$JobCharacteristics_3, na.rm=TRUE)
[1] 3.201769912
#standard deviation of whole sample
sd(BIL$JobCharacteristics_3, na.rm=TRUE)
[1] 1.179763041
#differences of means test
t.test(BIL$JobCharacteristics_3~BIL$GenderCategorical, mu = 0, alternative = "two.sided")
Welch Two Sample t-test
data: BIL$JobCharacteristics_3 by BIL$GenderCategorical
t = -2.2595512, df = 557.9797, p-value = 0.02423402
alternative hypothesis: true difference in means between group Female and group Male is not equal to 0
95 percent confidence interval:
-0.4171430769 -0.0291666630
sample estimates:
mean in group Female mean in group Male
3.098684211 3.321839080
#standard deviation for Male and Female subsets
tapply(BIL$JobCharacteristics_3, BIL$GenderCategorical, sd, na.rm=TRUE)
Female Male
1.206472470 1.138429278
#differences of variation test
var.test(BIL$JobCharacteristics_3~BIL$GenderCategorical, ratio = 1, alternative = "two.sided")
F test to compare two variances
data: BIL$JobCharacteristics_3 by BIL$GenderCategorical
F = 1.1231111, num df = 303, denom df = 260, p-value = 0.3342806
alternative hypothesis: true ratio of variances is not equal to 1
95 percent confidence interval:
0.8871298351 1.4188349526
sample estimates:
ratio of variances
1.123111102
Differences / Work Quality ()
Job engagement (Eng_1)
#mean of whole sample
mean(BIL$Eng_1, na.rm=TRUE)
[1] 7.927433628
#standard deviation of whole sample
sd(BIL$Eng_1, na.rm=TRUE)
[1] 2.016784525
#differences of means test
t.test(BIL$Eng_1~BIL$GenderCategorical, mu = 0, alternative = "two.sided")
Welch Two Sample t-test
data: BIL$Eng_1 by BIL$GenderCategorical
t = -2.9118507, df = 559.17064, p-value = 0.003736307
alternative hypothesis: true difference in means between group Female and group Male is not equal to 0
95 percent confidence interval:
-0.8101384795 -0.1574457108
sample estimates:
mean in group Female mean in group Male
7.703947368 8.187739464
#standard deviation for Male and Female subsets
tapply(BIL$Eng_1, BIL$GenderCategorical, sd, na.rm=TRUE)
Female Male
2.205121000 1.740690365
#differences of variation test
var.test(BIL$Eng_1~BIL$GenderCategorical, ratio = 1, alternative = "two.sided")
F test to compare two variances
data: BIL$Eng_1 by BIL$GenderCategorical
F = 1.6048033, num df = 303, denom df = 260, p-value = 0.00009286273
alternative hypothesis: true ratio of variances is not equal to 1
95 percent confidence interval:
1.267611774 2.027360393
sample estimates:
ratio of variances
1.604803266
Meaningful career (MW_PM_1)
#mean of whole sample
mean(BIL$MW_PM_1, na.rm=TRUE)
[1] 3.946902655
#standard deviation of whole sample
sd(BIL$MW_PM_1, na.rm=TRUE)
[1] 1.136442658
#differences of means test
t.test(BIL$MW_PM_1~BIL$GenderCategorical, mu = 0, alternative = "two.sided")
Welch Two Sample t-test
data: BIL$MW_PM_1 by BIL$GenderCategorical
t = -2.0106093, df = 559.33258, p-value = 0.04484619
alternative hypothesis: true difference in means between group Female and group Male is not equal to 0
95 percent confidence interval:
-0.378098345296 -0.004413249784
sample estimates:
mean in group Female mean in group Male
3.858552632 4.049808429
#standard deviation for Male and Female subsets
tapply(BIL$MW_PM_1, BIL$GenderCategorical, sd, na.rm=TRUE)
Female Male
1.170198938 1.089023010
#differences of variation test
var.test(BIL$MW_PM_1~BIL$GenderCategorical, ratio = 1, alternative = "two.sided")
F test to compare two variances
data: BIL$MW_PM_1 by BIL$GenderCategorical
F = 1.1546365, num df = 303, denom df = 260, p-value = 0.2317469
alternative hypothesis: true ratio of variances is not equal to 1
95 percent confidence interval:
0.9120313187 1.4586612484
sample estimates:
ratio of variances
1.154636513
Organizational commitment (Comm_1)
#mean of whole sample
mean(BIL$Comm_1, na.rm=TRUE)
[1] 5.104609929
#standard deviation of whole sample
sd(BIL$Comm_1, na.rm=TRUE)
[1] 1.823873659
#differences of means test
t.test(BIL$Comm_1~BIL$GenderCategorical, mu = 0, alternative = "two.sided")
Welch Two Sample t-test
data: BIL$Comm_1 by BIL$GenderCategorical
t = -2.4188501, df = 559.57851, p-value = 0.01588765
alternative hypothesis: true difference in means between group Female and group Male is not equal to 0
95 percent confidence interval:
-0.66807990314 -0.06929728285
sample estimates:
mean in group Female mean in group Male
4.933993399 5.302681992
#standard deviation for Male and Female subsets
tapply(BIL$Comm_1, BIL$GenderCategorical, sd, na.rm=TRUE)
Female Male
1.884653839 1.733258517
#differences of variation test
var.test(BIL$Comm_1~BIL$GenderCategorical, ratio = 1, alternative = "two.sided")
F test to compare two variances
data: BIL$Comm_1 by BIL$GenderCategorical
F = 1.182324, num df = 302, denom df = 260, p-value = 0.1639574
alternative hypothesis: true ratio of variances is not equal to 1
95 percent confidence interval:
0.9337530173 1.4939399803
sample estimates:
ratio of variances
1.182323988
Student’s Choice 1 (BirthYear)
#mean of whole sample
mean(BIL$BirthYear, na.rm=TRUE)
[1] 1977.339858
#standard deviation of whole sample
sd(BIL$BirthYear, na.rm=TRUE)
[1] 13.99389268
#differences of means test
t.test(BIL$BirthYear~BIL$GenderCategorical, mu = 0, alternative = "two.sided")
Welch Two Sample t-test
data: BIL$BirthYear by BIL$GenderCategorical
t = 2.994503, df = 553.7445, p-value = 0.002871766
alternative hypothesis: true difference in means between group Female and group Male is not equal to 0
95 percent confidence interval:
1.207713612 5.812945494
sample estimates:
mean in group Female mean in group Male
1978.97010 1975.45977
#standard deviation for Male and Female subsets
tapply(BIL$BirthYear, BIL$GenderCategorical, sd, na.rm=TRUE)
Female Male
14.13019591 13.62108484
#differences of variation test
var.test(BIL$BirthYear~BIL$GenderCategorical, ratio = 1, alternative = "two.sided")
F test to compare two variances
data: BIL$BirthYear by BIL$GenderCategorical
F = 1.0761504, num df = 300, denom df = 260, p-value = 0.5428865
alternative hypothesis: true ratio of variances is not equal to 1
95 percent confidence interval:
0.849629123 1.360335941
sample estimates:
ratio of variances
1.076150397
Student’s Choice 2 (YearsOld)
#mean of whole sample
mean(BIL$YearsOld, na.rm=TRUE)
[1] 47.66014235
#standard deviation of whole sample
sd(BIL$YearsOld, na.rm=TRUE)
[1] 13.99389268
#differences of means test
t.test(BIL$YearsOld~BIL$GenderCategorical, mu = 0, alternative = "two.sided")
Welch Two Sample t-test
data: BIL$YearsOld by BIL$GenderCategorical
t = -2.994503, df = 553.7445, p-value = 0.002871766
alternative hypothesis: true difference in means between group Female and group Male is not equal to 0
95 percent confidence interval:
-5.812945494 -1.207713612
sample estimates:
mean in group Female mean in group Male
46.02990033 49.54022989
#standard deviation for Male and Female subsets
tapply(BIL$YearsOld, BIL$GenderCategorical, sd, na.rm=TRUE)
Female Male
14.13019591 13.62108484
#differences of variation test
var.test(BIL$YearsOld~BIL$GenderCategorical, ratio = 1, alternative = "two.sided")
F test to compare two variances
data: BIL$YearsOld by BIL$GenderCategorical
F = 1.0761504, num df = 300, denom df = 260, p-value = 0.5428865
alternative hypothesis: true ratio of variances is not equal to 1
95 percent confidence interval:
0.849629123 1.360335941
sample estimates:
ratio of variances
1.076150397
Student’s Choice 3 (EqualityValue)
#mean of whole sample
mean(BIL$EqualityValue, na.rm=TRUE)
[1] 7.887537994
#standard deviation of whole sample
sd(BIL$EqualityValue, na.rm=TRUE)
[1] 1.767280835
#differences of means test
t.test(BIL$EqualityValue~BIL$GenderCategorical, mu = 0, alternative = "two.sided")
Welch Two Sample t-test
data: BIL$EqualityValue by BIL$GenderCategorical
t = -2.2013662, df = 561.12976, p-value = 0.02811646
alternative hypothesis: true difference in means between group Female and group Male is not equal to 0
95 percent confidence interval:
-0.61107607606 -0.03479146636
sample estimates:
mean in group Female mean in group Male
7.738095238 8.061029009
#standard deviation for Male and Female subsets
tapply(BIL$EqualityValue, BIL$GenderCategorical, sd, na.rm=TRUE)
Female Male
1.905771768 1.577401656
#differences of variation test
var.test(BIL$EqualityValue~BIL$GenderCategorical, ratio = 1, alternative = "two.sided")
F test to compare two variances
data: BIL$EqualityValue by BIL$GenderCategorical
F = 1.4596784, num df = 302, denom df = 260, p-value = 0.001739472
alternative hypothesis: true ratio of variances is not equal to 1
95 percent confidence interval:
1.152796662 1.844394599
sample estimates:
ratio of variances
1.459678439
Student’s Choice 4 (SafeConditions_2)
#mean of whole sample
mean(BIL$SafeConditions_2, na.rm=TRUE)
[1] 5.542402827
#standard deviation of whole sample
sd(BIL$SafeConditions_2, na.rm=TRUE)
[1] 1.482930805
#differences of means test
t.test(BIL$SafeConditions_2~BIL$GenderCategorical, mu = 0, alternative = "two.sided")
Welch Two Sample t-test
data: BIL$SafeConditions_2 by BIL$GenderCategorical
t = -2.5500208, df = 558.54846, p-value = 0.01103752
alternative hypothesis: true difference in means between group Female and group Male is not equal to 0
95 percent confidence interval:
-0.5592698389 -0.0725748945
sample estimates:
mean in group Female mean in group Male
5.396721311 5.712643678
#standard deviation for Male and Female subsets
tapply(BIL$SafeConditions_2, BIL$GenderCategorical, sd, na.rm=TRUE)
Female Male
1.514183731 1.429696412
#differences of variation test
var.test(BIL$SafeConditions_2~BIL$GenderCategorical, ratio = 1, alternative = "two.sided")
F test to compare two variances
data: BIL$SafeConditions_2 by BIL$GenderCategorical
F = 1.1216813, num df = 304, denom df = 260, p-value = 0.339295
alternative hypothesis: true ratio of variances is not equal to 1
95 percent confidence interval:
0.8861403537 1.4167449814
sample estimates:
ratio of variances
1.121681345
Proportions for Whole Sample
tab1(BIL$HighIncome, graph = FALSE)
BIL$HighIncome :
Frequency %(NA+) %(NA-)
0 379 67.0 67.3
1 184 32.5 32.7
<NA> 3 0.5 0.0
Total 566 100.0 100.0
Married or Cohabitating vs Single (Married)
Income above $100,000 (HighIncome)
MarriedHighIncome <- table(BIL$MarriedCategorical, BIL$HighIncome)
MarriedHighIncome <- addmargins(MarriedHighIncome)
MarriedHighIncome
0 1 Sum
Married 214 139 353
NotMarried 164 42 206
Sum 378 181 559
prop.test(x = c(139, 42), n = c(353, 206), correct = F, alternative = "two.sided")
2-sample test for equality of proportions without continuity correction
data: c(139, 42) out of c(353, 206)
X-squared = 21.422052, df = 1, p-value = 0.000003685084
alternative hypothesis: two.sided
95 percent confidence interval:
0.1148868965 0.2648815240
sample estimates:
prop 1 prop 2
0.3937677054 0.2038834951
sqrt(21.422052)
[1] 4.628396267
College Degree (CollegeDegree)
tab1(BIL$CollegeDegree, graph = FALSE)
BIL$CollegeDegree :
Frequency %(NA+) %(NA-)
0 249 44.0 44.2
1 314 55.5 55.8
<NA> 3 0.5 0.0
Total 566 100.0 100.0
MarriedCollegeDegree <- table(BIL$MarriedCategorical, BIL$CollegeDegree)
MarriedCollegeDegree <- addmargins(MarriedCollegeDegree)
MarriedCollegeDegree
0 1 Sum
Married 127 226 353
NotMarried 121 85 206
Sum 248 311 559
prop.test(x = c(226, 85), n = c(353, 206), correct = F, alternative = "two.sided")
2-sample test for equality of proportions without continuity correction
data: c(226, 85) out of c(353, 206)
X-squared = 27.302744, df = 1, p-value = 0.0000001739644
alternative hypothesis: two.sided
95 percent confidence interval:
0.1437829396 0.3114275997
sample estimates:
prop 1 prop 2
0.6402266289 0.4126213592
sqrt(27.302744)
[1] 5.225202771
In Sales or Business Development (SAL, 1 Yes, 2 No)
tab1(BIL$SAL, graph = FALSE)
BIL$SAL :
Frequency %(NA+) %(NA-)
1 113 20.0 20.2
2 447 79.0 79.8
<NA> 6 1.1 0.0
Total 566 100.0 100.0
MarriedSAL <- table(BIL$MarriedCategorical, BIL$SAL)
MarriedSAL <- addmargins(MarriedSAL)
MarriedSAL
1 2 Sum
Married 71 279 350
NotMarried 40 166 206
Sum 111 445 556
prop.test(x = c(71, 40), n = c(350, 206), correct = F, alternative = "two.sided")
2-sample test for equality of proportions without continuity correction
data: c(71, 40) out of c(350, 206)
X-squared = 0.061179399, df = 1, p-value = 0.8046415
alternative hypothesis: two.sided
95 percent confidence interval:
-0.05982067087 0.07718544202
sample estimates:
prop 1 prop 2
0.2028571429 0.1941747573
sqrt(.0435)
[1] 0.2085665361
More than 10 years in organization (OrgYearsMoreThanTen)
tab1(BIL$OrgYearsMoreThanTen, graph = FALSE)
BIL$OrgYearsMoreThanTen :
Frequency %(NA+) %(NA-)
0 399 70.5 71.4
1 160 28.3 28.6
<NA> 7 1.2 0.0
Total 566 100.0 100.0
MarriedOrgYears_table <- table(BIL$MarriedCategorical, BIL$OrgYearsMoreThanTen)
MarriedOrgYears_table <- addmargins(MarriedOrgYears_table)
MarriedOrgYears_table
0 1 Sum
Married 238 111 349
NotMarried 157 49 206
Sum 395 160 555
prop.test(x = c(111, 49), n = c(349, 206), correct = F)
2-sample test for equality of proportions without continuity correction
data: c(111, 49) out of c(349, 206)
X-squared = 4.0595873, df = 1, p-value = 0.04392123
alternative hypothesis: two.sided
95 percent confidence interval:
0.004240522882 0.156134473640
sample estimates:
prop 1 prop 2
0.3180515759 0.2378640777
sqrt(4.4969)
[1] 2.120589541
Student Choice (SafeConditions_2)
tab1(BIL$SafeConditions_2, graph = FALSE)
BIL$SafeConditions_2 :
Frequency Percent Cum. percent
1 15 2.7 2.7
2 20 3.5 6.2
3 28 4.9 11.1
4 43 7.6 18.7
5 88 15.5 34.3
6 218 38.5 72.8
7 154 27.2 100.0
Total 566 100.0 100.0
MarriedSafeConditions_2 <- table(BIL$MarriedCategorical, BIL$SafeConditions_2)
MarriedSafeConditions_2 <- addmargins(MarriedSafeConditions_2)
MarriedSafeConditions_2
1 2 3 4 5 6 7 Sum
Married 10 13 21 21 44 143 101 353
NotMarried 5 7 7 21 41 73 52 206
Sum 15 20 28 42 85 216 153 559
prop.test(x = c(244, 125), n = c(353, 206), correct = F)
2-sample test for equality of proportions without continuity correction
data: c(244, 125) out of c(353, 206)
X-squared = 4.1322366, df = 1, p-value = 0.04207371
alternative hypothesis: two.sided
95 percent confidence interval:
0.002130138065 0.166713889548
sample estimates:
prop 1 prop 2
0.6912181303 0.6067961165
sqrt(4.1322366)
[1] 2.032790348
Subsetting Female Respondents
#Create a subset of only female respondents
Female <- subset(BIL, Gender == 1)
Proportions Female in Utah and Female not in Utah
#Income above $100,000
FemaleUtahHighIncome <- table(Female$Utah, Female$HighIncome)
FemaleUtahHighIncome <- addmargins(FemaleUtahHighIncome)
FemaleUtahHighIncome
0 1 Sum
0 136 55 191
1 91 20 111
Sum 227 75 302
prop.test(x = c(20, 55), n = c(111, 191), correct = F, alternative = "two.sided")
2-sample test for equality of proportions without continuity correction
data: c(20, 55) out of c(111, 191)
X-squared = 4.3685357, df = 1, p-value = 0.03660844
alternative hypothesis: two.sided
95 percent confidence interval:
-0.20388148579 -0.01167438421
sample estimates:
prop 1 prop 2
0.1801801802 0.2879581152
sqrt(4.3685357)
[1] 2.090104232
MGMT 3345 Unit 2 Project
STEP 1: TESTS OF INDEPENDENCE
Q1 Is there a relationship between gender (GenderCategorical) and the opportunity to learn and grow in a job (Engagement_Q12_12)?
Step1Q1 <- table(BIL$GenderCategorical, BIL$Engagement_Q12_12)
Step1Q1
1 2 3 4 5
Female 28 28 36 105 107
Male 8 20 39 86 108
chisq.test(Step1Q1 [, 1 : 5], correct = F)
Pearson's Chi-squared test
data: Step1Q1[, 1:5]
X-squared = 11.251753, df = 4, p-value = 0.0238757
There is a relationship between Gender and Engagment.
Q2 Is there a relationship between gender (GenderCategorical) and their position or leadership role in the organization (Position)?
Step1Q2 <- table(BIL$GenderCategorical, BIL$Position)
Step1Q2
1 2 3 4 5 6
Female 137 45 71 21 16 12
Male 79 47 66 33 21 15
chisq.test(Step1Q2 [, 1 : 6], correct = F)
Pearson's Chi-squared test
data: Step1Q2[, 1:6]
X-squared = 16.577838, df = 5, p-value = 0.005374099
There is a relationship between Gender and Position
Q3 Student’s Choice (how would you describe relations at your workplace… - … between management and employees?. WorkRelations_1)
Step1Q3 <- table(BIL$RaceCategorical, BIL$WorkRelations_1)
Step1Q3
1 2 3 4 5
Asian 0 2 20 19 14
BlackorAfricanAmerican 4 7 26 51 24
NativeAmericanAlaskan 0 0 0 2 0
NativeHawaiianPacificIslander 0 1 1 2 0
Other 0 0 2 5 2
White 14 29 87 165 88
chisq.test(Step1Q3 [, 1 : 5], correct = F)
Pearson's Chi-squared test
data: Step1Q3[, 1:5]
X-squared = 15.240989, df = 20, p-value = 0.762456
There is not a relationship between Race and how In general, “how would you describe relations at your workplace… - … between management and employees?”
Q4 Student’s Choice (Please indicate the extent to which you agree or disagree with each statement. - My supervisor shows trust in me. EmpatLead_5)
Step1Q4 <- table(BIL$RaceCategorical, BIL$EmpatLead_5)
Step1Q4
1 2 3 4 5 6 7
Asian 0 0 3 9 11 18 14
BlackorAfricanAmerican 3 5 4 10 17 42 31
NativeAmericanAlaskan 0 0 0 0 0 2 0
NativeHawaiianPacificIslander 0 0 0 2 1 0 1
Other 0 0 1 0 2 5 1
White 17 12 9 31 70 107 136
chisq.test(Step1Q4 [, 1 : 7], correct = F)
Pearson's Chi-squared test
data: Step1Q4[, 1:7]
X-squared = 36.939308, df = 30, p-value = 0.1789195
There is not a relationship between race and My supervisor shows trust in me.
STEP 2: ONE-WAY ANOVA
Q1 Are there differences in average job satisfaction (JobSat) among the differing age brackets (Generation)? If so, identify which age brackets differ and provide their corresponding confidence intervals.
AnovaJobSatGeneration <- aov(JobSat ~ Generation, data = BIL)
anova(AnovaJobSatGeneration)
Analysis of Variance Table
Response: JobSat
Df Sum Sq Mean Sq F value Pr(>F)
Generation 3 33.93639 11.3121295 2.17266 0.090219 .
Residuals 557 2900.06711 5.2065837
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Q2 Student’s Choice (EmpatLead_3) Please indicate the extent to which you agree or disagree with each statement. - My supervisor shows concern about my job satisfaction. Based off race (RaceCategorical)
AnovaEmpatLead_3RaceCategorical <- aov(EmpatLead_3 ~ RaceCategorical, data = BIL)
anova(AnovaEmpatLead_3RaceCategorical)
Analysis of Variance Table
Response: EmpatLead_3
Df Sum Sq Mean Sq F value Pr(>F)
RaceCategorical 5 5.39531 1.0790623 0.36694 0.87126
Residuals 558 1640.89547 2.9406729
Q3 Student’s Choice (RaceCategorical) , ILAvail_4 Please indicate the extent to which YOUR LEADER displays the following behaviors. - My leader is ready to listen to my requests.
AnovaILAvail_4RaceCategorical <- aov(ILAvail_4 ~ RaceCategorical, data = BIL)
anova(AnovaILAvail_4RaceCategorical)
Analysis of Variance Table
Response: ILAvail_4
Df Sum Sq Mean Sq F value Pr(>F)
RaceCategorical 5 2.67048 0.53409657 0.50317 0.77395
Residuals 558 592.30115 1.06147159
STEP 3: TWO-WAY ANOVA (without interaction)
Q1: Are there differences in average job satisfaction (JobSat) among the differing age brackets (Generation) and current work arrangement (CurrWA)? If so, identify which age brackets or work arrangements differ and provide their corresponding confidence intervals.
Anova2Step3Q1 <- aov(JobSat ~ Generation + CurrWA, data=BIL)
anova(Anova2Step3Q1)
Analysis of Variance Table
Response: JobSat
Df Sum Sq Mean Sq F value Pr(>F)
Generation 3 33.93639 11.3121295 2.16978 0.090561 .
CurrWA 1 1.36491 1.3649081 0.26180 0.609087
Residuals 556 2898.70220 5.2134932
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Q2 Student’s Choice (Include research question and the name of the variables.)(PreCovidWA), (RaceCategorical), (ILAvail_4), Please indicate the extent to which YOUR LEADER displays the following behaviors. - My leader is ready to listen to my requests.
Anova2Step3Q2 <- aov(ILAvail_4 ~ RaceCategorical + PreCovidWA, data=BIL)
anova(Anova2Step3Q2)
Analysis of Variance Table
Response: ILAvail_4
Df Sum Sq Mean Sq F value Pr(>F)
RaceCategorical 5 2.67048 0.53409657 0.50229 0.77460
PreCovidWA 1 0.03480 0.03479852 0.03273 0.85651
Residuals 557 592.26635 1.06331481
Q3 Student’s Choice (JobCharacteristics_5)For each of these statements about your job, please identify how much you agree or disagree that each applies to YOUR JOB. - I can work independently.(GenderCategorical), (PreCovidWA)
Anova2Step3Q3 <- aov(JobCharacteristics_5 ~ GenderCategorical + PreCovidWA, data=BIL)
anova(Anova2Step3Q3)
Analysis of Variance Table
Response: JobCharacteristics_5
Df Sum Sq Mean Sq F value Pr(>F)
GenderCategorical 1 0.12667 0.12667343 0.12857 0.72006
PreCovidWA 1 0.34534 0.34533706 0.35050 0.55407
Residuals 562 553.71560 0.98525907
STEP 4: TWO-WAY ANOVA (with interaction)
Q1 Is there an interaction in average job satisfaction (JobSat) among the differing age brackets (Generation) and current work arrangement (CurrWA)?
Anova3Step4Q1 <- aov(JobSat ~ Generation*CurrWA, data=BIL)
anova(Anova3Step4Q1)
Analysis of Variance Table
Response: JobSat
Df Sum Sq Mean Sq F value Pr(>F)
Generation 3 33.93639 11.3121295 2.17296 0.090192 .
CurrWA 1 1.36491 1.3649081 0.26219 0.608826
Generation:CurrWA 3 19.85805 6.6193486 1.27152 0.283318
Residuals 553 2878.84416 5.2058665
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Q2 Student’s Choice (EmpatLead_5), Please indicate the extent to which you agree or disagree with each statement. - My supervisor shows trust in me.(RaceCategorical), (Title)
Anova3Step4Q2 <- aov(EmpatLead_5 ~ RaceCategorical*Title, data=BIL)
anova(Anova3Step4Q2)
Analysis of Variance Table
Response: EmpatLead_5
Df Sum Sq Mean Sq F value Pr(>F)
RaceCategorical 5 2.32837 0.46567493 0.20619 0.95915
Title 427 964.15014 2.25796285 0.99977 0.51414
RaceCategorical:Title 29 76.28012 2.63034882 1.16465 0.28578
Residuals 95 214.55556 2.25847953
Q3 Student’s Choice My supervisor shows trust in me (EmpatLead_5), (GenderCategorica), (Title)
Anova3Step4Q3 <- aov(EmpatLead_5 ~ GenderCategorical*Title, data=BIL)
anova(Anova3Step4Q3)
Analysis of Variance Table
Response: EmpatLead_5
Df Sum Sq Mean Sq F value Pr(>F)
GenderCategorical 1 6.82963 6.8296271 2.85812 0.093853 .
Title 429 953.08957 2.2216540 0.92974 0.694539
GenderCategorical:Title 20 44.10212 2.2051062 0.92281 0.559971
Residuals 106 253.29286 2.3895553
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
MGMT 3345 Unit 3 Project
options(scipen=999)
options(digits=10)
STEP 1 Create subsets for your two chosen groups:
White <- subset(BIL, White == 1)
NonWhite <- subset(BIL, White == 0)
Eng_1 Overall, how engaged are you in your (main) job? - Work Engagement
SafeConditions_1 , Please indicate the extent to which you agree or disagree with each statement. - I feel emotionally safe interacting with people at work.
AdeqComp_3 , Please indicate the extent to which you agree or disagree with each statement. - I am rewarded adequately for my work.
FreeTime_Rest_2 , Please indicate the extent to which you agree or disagree with each statement. - I have no time to rest during the work week.
NSM_6 , “My manager/supervisor/work unit leader… - … makes sure I understand the purpose of my work.”
Eng_1 Overall, how engaged are you in your (main) job? - Work Engagement
Indignity , I suffer indignity at work. (Indignity_1 + Indignity_2 + Indignity_3 + Indignity_4) (1) strongly disagree to (10) strongly agree
STEP 2 Check for the no multicollinearity assumption by creating a correlation coefficient chart of all your added predictor variables.
Load corrplot package.
#Correlation Coefficient Heat Map
JobSatVariablesWhite <- data.frame( White$SafeConditions_1 , White$Eng_1 , White$AdeqComp_3 , White$FreeTime_Rest_2 , White$NSM_6, White$Indignity)
correl<-corrplot(cor(as.matrix(JobSatVariablesWhite), use = "complete.obs", method = "pearson"),
method = "color",
tl.cex = 0.5,
number.cex = 0.5,
addCoef.col = "black")
#Correlation Coefficient Heat Map
JobSatVariablesNonWhite <- data.frame( NonWhite$SafeConditions_1 , NonWhite$Eng_1 , NonWhite$AdeqComp_3 , NonWhite$FreeTime_Rest_2 , NonWhite$NSM_6, NonWhite$Indignity)
correl<-corrplot(cor(as.matrix(JobSatVariablesNonWhite), use = "complete.obs", method = "pearson"),
method = "color",
tl.cex = 0.5,
number.cex = 0.5,
addCoef.col = "black")
STEP 3 First Group JobSat Regression Model
WhiteLinearProbModel <- lm(JobSat ~ YearsOld + Utah + Married + Gender + Educ + log(OrgSize +1) + Income_1 + SAL + WorkExp + SafeConditions_1 + Eng_1 + AdeqComp_3 + FreeTime_Rest_2 + NSM_6 +Indignity , data = White)
summary(WhiteLinearProbModel)
Call:
lm(formula = JobSat ~ YearsOld + Utah + Married + Gender + Educ +
log(OrgSize + 1) + Income_1 + SAL + WorkExp + SafeConditions_1 +
Eng_1 + AdeqComp_3 + FreeTime_Rest_2 + NSM_6 + Indignity,
data = White)
Residuals:
Min 1Q Median 3Q Max
-5.9359364 -0.6281722 0.1453956 0.8577432 3.4172546
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -2.9186313952 1.0531515789 -2.77133 0.0058727 **
YearsOld -0.0010653710 0.0090019883 -0.11835 0.9058576
Utah 0.0691925284 0.1636594141 0.42278 0.6727055
Married 0.2913218855 0.1700945101 1.71271 0.0876277 .
Gender -0.0336578476 0.1612830722 -0.20869 0.8348098
Educ -0.0046614332 0.0745277862 -0.06255 0.9501625
log(OrgSize + 1) -0.0896117166 0.1088862790 -0.82298 0.4110616
Income_1 0.0006086496 0.0010272319 0.59251 0.5538782
SAL 0.0908952667 0.1991253108 0.45647 0.6483254
WorkExp 0.0075319240 0.0088658143 0.84955 0.3961417
SafeConditions_1 0.1029527623 0.0634792841 1.62183 0.1057147
Eng_1 0.4148040963 0.0512163879 8.09905 0.0000000000000086765 ***
AdeqComp_3 0.3383291114 0.0547678327 6.17752 0.0000000017610993073 ***
FreeTime_Rest_2 -0.0598086166 0.0473457932 -1.26323 0.2073241
NSM_6 0.4330822464 0.0639126449 6.77616 0.0000000000505418125 ***
Indignity -0.1661307704 0.0538519414 -3.08495 0.0021933 **
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 1.474661 on 360 degrees of freedom
(7 observations deleted due to missingness)
Multiple R-squared: 0.6289715, Adjusted R-squared: 0.6135119
F-statistic: 40.68505 on 15 and 360 DF, p-value: < 0.00000000000000022204
0.6138574 Load broom package
#Regression Output Table
tidy(summary(WhiteLinearProbModel))
#Confidence Intervals Table
confint_tidy(WhiteLinearProbModel, conf.level = 0.95)
Second Group JobSat Regression Model
NonWhiteLinearProbModel <- lm(JobSat ~ YearsOld + Utah + Married + Gender + Educ + log(OrgSize +1) + Income_1 + SAL + WorkExp + SafeConditions_1 + Eng_1 + AdeqComp_3 + FreeTime_Rest_2 + NSM_6 +Indignity , data = NonWhite)
summary(NonWhiteLinearProbModel)
Call:
lm(formula = JobSat ~ YearsOld + Utah + Married + Gender + Educ +
log(OrgSize + 1) + Income_1 + SAL + WorkExp + SafeConditions_1 +
Eng_1 + AdeqComp_3 + FreeTime_Rest_2 + NSM_6 + Indignity,
data = NonWhite)
Residuals:
Min 1Q Median 3Q Max
-3.3714793 -0.6245085 0.0409851 0.7877643 3.3363591
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -3.2347064191 1.3388254517 -2.41608 0.0167867 *
YearsOld 0.0135263376 0.0109478981 1.23552 0.2184043
Utah -0.1553901785 0.3324945700 -0.46735 0.6408723
Married 0.3743270100 0.1950941015 1.91870 0.0567593 .
Gender -0.3204019198 0.1985009089 -1.61411 0.1084264
Educ 0.1432057585 0.0903742556 1.58459 0.1149869
log(OrgSize + 1) -0.1037623825 0.1302039759 -0.79692 0.4266487
Income_1 0.0008507020 0.0009472792 0.89805 0.3704766
SAL -0.2988686332 0.2580396469 -1.15823 0.2484551
WorkExp -0.0060337511 0.0114521690 -0.52687 0.5989990
SafeConditions_1 0.0188948618 0.0707131522 0.26720 0.7896475
Eng_1 0.5539689389 0.0569329915 9.73019 < 0.000000000000000222 ***
AdeqComp_3 0.2372852211 0.0763517170 3.10779 0.0022223 **
FreeTime_Rest_2 -0.0285763913 0.0601456525 -0.47512 0.6353337
NSM_6 0.3920102908 0.0817158786 4.79724 0.0000035928 ***
Indignity 0.0795170851 0.0574735079 1.38354 0.1683787
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 1.227218 on 164 degrees of freedom
(3 observations deleted due to missingness)
Multiple R-squared: 0.6828561, Adjusted R-squared: 0.653849
F-statistic: 23.54103 on 15 and 164 DF, p-value: < 0.00000000000000022204
Load broom package
#Regression Output Table
tidy(summary(NonWhiteLinearProbModel))
#Confidence Intervals Table
confint_tidy(NonWhiteLinearProbModel, conf.level = 0.95)
STEP 4
Logistic Regression Does not worry at all coded as 0, any level of worry coded as 1.
White$DummyEmployability1 <- ifelse(White$Employability1 == "4", 0, 1)
NonWhite$DummyEmployability1 <- ifelse(NonWhite$Employability1 == "4", 0, 1)
First Group Worry Logistic Model
WhiteWorry <- glm(DummyEmployability1 ~ YearsOld + Utah + Married + Gender + Educ + log(OrgSize +1) + Income_1 + SAL + WorkExp + SafeConditions_1 + Eng_1 + AdeqComp_3 + FreeTime_Rest_2 + NSM_6 +Indignity, family = binomial, data = White)
summary(WhiteWorry)
Call:
glm(formula = DummyEmployability1 ~ YearsOld + Utah + Married +
Gender + Educ + log(OrgSize + 1) + Income_1 + SAL + WorkExp +
SafeConditions_1 + Eng_1 + AdeqComp_3 + FreeTime_Rest_2 +
NSM_6 + Indignity, family = binomial, data = White)
Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) 2.2081208779 1.6669356917 1.32466 0.185284
YearsOld -0.0217598343 0.0135799683 -1.60235 0.109079
Utah 0.3696857612 0.2483709239 1.48844 0.136634
Married -0.3646573782 0.2597636042 -1.40380 0.160377
Gender -0.1562767575 0.2454418364 -0.63672 0.524310
Educ 0.0808459355 0.1129759148 0.71560 0.474236
log(OrgSize + 1) 0.1270293348 0.1647165897 0.77120 0.440589
Income_1 0.0007761363 0.0016760434 0.46308 0.643310
SAL -0.2351689263 0.3119500502 -0.75387 0.450929
WorkExp 0.0195823859 0.0132786887 1.47472 0.140287
SafeConditions_1 0.0393222397 0.0987998336 0.39800 0.690631
Eng_1 -0.0978669149 0.0847668919 -1.15454 0.248278
AdeqComp_3 -0.0254128928 0.0825934757 -0.30769 0.758321
FreeTime_Rest_2 0.1627894579 0.0720034356 2.26086 0.023768 *
NSM_6 -0.0978090338 0.1006940677 -0.97135 0.331375
Indignity 0.2026735881 0.0882419771 2.29679 0.021631 *
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 483.58160 on 375 degrees of freedom
Residual deviance: 439.39549 on 360 degrees of freedom
(7 observations deleted due to missingness)
AIC: 471.39549
Number of Fisher Scoring iterations: 4
#Logistic Regression Output in a Table
tidy(WhiteWorry, conf.int = FALSE, conf.level = 0.95, exponentiate = FALSE)
#PseudoR2
PseudoR2(WhiteWorry, which = "all")
McFadden McFaddenAdj CoxSnell Nagelkerke AldrichNelson VeallZimmermann Efron McKelveyZavoina Tjur AIC
0.09137259527 0.02519968839 0.11087392617 0.15321285081 0.10515841665 0.18692241447 0.11953087076 0.16858457078 0.11529239117 471.39549165020
BIC logLik logLik0 G2
534.26891794444 -219.69774582510 -241.79079860483 44.18610555947
#% Change in Odds Table
tidy((exp(coef(WhiteWorry))-1) * 100)
Second Group Worry Logistic Model
NonWhiteWorry <- glm(DummyEmployability1 ~ YearsOld + Utah + Married + Gender + Educ + log(OrgSize +1) + Income_1 + SAL + WorkExp + SafeConditions_1 + Eng_1 + AdeqComp_3 + FreeTime_Rest_2 + NSM_6 +Indignity, family = binomial, data = NonWhite)
summary(NonWhiteWorry)
Call:
glm(formula = DummyEmployability1 ~ YearsOld + Utah + Married +
Gender + Educ + log(OrgSize + 1) + Income_1 + SAL + WorkExp +
SafeConditions_1 + Eng_1 + AdeqComp_3 + FreeTime_Rest_2 +
NSM_6 + Indignity, family = binomial, data = NonWhite)
Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) 4.7260287131 2.6940747889 1.75423 0.0793910 .
YearsOld 0.0200420847 0.0205098501 0.97719 0.3284735
Utah -0.6102711990 0.6406683499 -0.95255 0.3408161
Married 0.9889826634 0.3882086680 2.54755 0.0108481 *
Gender -0.0238976225 0.3804448743 -0.06281 0.9499139
Educ -0.2099760980 0.1775298539 -1.18277 0.2369023
log(OrgSize + 1) 0.1484413857 0.2455053124 0.60464 0.5454208
Income_1 -0.0008932385 0.0018080253 -0.49404 0.6212773
SAL -0.5261233920 0.5151772427 -1.02125 0.3071373
WorkExp -0.0372229730 0.0218277412 -1.70531 0.0881374 .
SafeConditions_1 -0.2520417006 0.1398166245 -1.80266 0.0714418 .
Eng_1 0.0472279360 0.1106029516 0.42700 0.6693762
AdeqComp_3 -0.2540989583 0.1475134612 -1.72255 0.0849704 .
FreeTime_Rest_2 -0.0272470592 0.1170542228 -0.23277 0.8159377
NSM_6 -0.1745480991 0.1628900013 -1.07157 0.2839130
Indignity 0.4106219730 0.1268541352 3.23696 0.0012081 **
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 243.07202 on 179 degrees of freedom
Residual deviance: 193.84254 on 164 degrees of freedom
(3 observations deleted due to missingness)
AIC: 225.84254
Number of Fisher Scoring iterations: 4
#Logistic Regression Output in a Table
tidy(NonWhiteWorry, conf.int = FALSE, conf.level = 0.95, exponentiate = FALSE)
#PseudoR2
PseudoR2(NonWhiteWorry, which = "all")
McFadden McFaddenAdj CoxSnell Nagelkerke AldrichNelson VeallZimmermann Efron McKelveyZavoina Tjur AIC BIC
0.2025304106 0.0708821841 0.2392854469 0.3229818535 0.2147606689 0.3737955131 0.2612560331 0.3383271621 0.2552577297 225.8425418557 276.9298514700
logLik logLik0 G2
-96.9212709279 -121.5360086690 49.2294754822
#% Change in Odds Table
tidy((exp(coef(NonWhiteWorry))-1) * 100)
```