Research question. Do M4 qualification scores differ across time in active service years among soldiers in CAB with the same skill level?
Put this file and army_brigades_synthetic.csv in the
same folder. Open this file in RStudio and click Knit.
The analysis uses base R.
Of 2,700 synthetic CAB records, 2,516 had an observed M4 score and nonnegative service time. The raw missing counts were 175 M4 scores and seven service times. Two service times were negative. Among the 2,516 eligible records, 539 lacked a skill level, leaving 1,977 for the multiple regression. Excluding records with missing skill levels may change who the analysis represents. Observed M4 scores range from 23 to 40 with a pileup at 23. The results concern recorded scores. Check Annex B for how failing attempts and missing skill levels are coded.
I selected Skill Level 1 for the t-tests because it had the most eligible records. The regression uses all five recorded skill levels.
army <- read.csv("army_brigades_synthetic.csv", na.strings = c("", "NA"))
army$csv_row <- seq_len(nrow(army)) # Data row, excluding the header
cab <- subset(army, brigade == "CAB")
cab$years <- cab$time_in_active_service_years
eligible <- subset(cab, !is.na(m4) & !is.na(years) & years >= 0)
table(eligible$skill_level, useNA = "ifany")
##
## Skill Level 1 Skill Level 2 Skill Level 3 Skill Level 4 Skill Level 5
## 1259 397 225 75 21
## <NA>
## 539
clean <- subset(eligible, !is.na(skill_level))
clean$skill_level <- factor(clean$skill_level)
same_skill <- subset(clean, skill_level == "Skill Level 1")
early <- subset(same_skill, years < 4)
later <- subset(same_skill, years >= 4)
I used four years as an illustrative planning cutoff to distinguish earlier-service Soldiers from those with more accumulated service. It is an analyst-chosen cutoff. Both tests are two-sided at the 0.05 level. A separate look at continuous service time follows.
Let \(\mu_E\) be the population mean recorded M4 score for CAB Soldiers at Skill Level 1 with under four years of service, under the process represented by the synthetic data. Test \(H_0: \mu_E = 30\) against \(H_A: \mu_E \ne 30\). Thirty hits is the lower bound for an individual’s sharpshooter rating on the Army’s 40-target rifle/carbine qualification. It gives the early-service mean a published reference point. See TC 3-20.40, Table 1-13.
t.test(early$m4, mu = 30)
##
## One Sample t-test
##
## data: early$m4
## t = -22.822, df = 1108, p-value < 2.2e-16
## alternative hypothesis: true mean is not equal to 30
## 95 percent confidence interval:
## 26.89680 27.38814
## sample estimates:
## mean of x
## 27.14247
The early-service group averaged 27.14 hits (n = 1,109, SD = 4.17). Under the standard t-test assumptions, t(1108) = −22.82, p < .001, so reject equality to 30. The 95% CI of 26.90 to 27.39 puts the estimated group mean below the benchmark. This comparison is about the mean. In this sample, 297 of 1,109 early-service records individually reached 30.
Let \(\mu_L\) be the corresponding population mean for CAB Skill Level 1 Soldiers with at least four years of service. Test \(H_0: \mu_L - \mu_E = 0\) against \(H_A: \mu_L - \mu_E \ne 0\). The groups contain different Soldiers, with no matching or before-and-after measurements. Welch’s test accommodates different group variances. Holding skill level fixed makes the comparison relevant to whether a service-time grouping would identify a meaningful score gap within one specialty.
c(later_mean = mean(later$m4), later_sd = sd(later$m4), later_n = nrow(later))
## later_mean later_sd later_n
## 31.373333 4.579714 150.000000
t.test(later$m4, early$m4, paired = FALSE, var.equal = FALSE)
##
## Welch Two Sample t-test
##
## data: later$m4 and early$m4
## t = 10.729, df = 183.97, p-value < 2.2e-16
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
## 3.452857 5.008868
## sample estimates:
## mean of x mean of y
## 31.37333 27.14247
par(mfrow = c(1, 2))
hist(early$m4, breaks = seq(22.5, 40.5), main = "Under 4 years", xlab = "M4 hits")
hist(later$m4, breaks = seq(22.5, 40.5), main = "4 years or more", xlab = "M4 hits")
par(mfrow = c(1, 1))
The later-service group averaged 31.37 hits (n = 150, SD = 4.58). Its mean was 4.23 hits higher, with a nominal 95% CI of 3.45 to 5.01 and Welch t(183.97) = 10.73, p < .001. A difference of roughly three to five hits on a 40-target scale is large enough for a commander to investigate in real records. The group means also fall on opposite sides of the 30-hit reference.
Scores are quantitative. The early group is right-skewed with a pileup at 23, and the later group is approximately symmetric. With 1,109 and 150 observations, the mean-based approximations are reasonable if observations are independent. The CSV has no Soldier ID to verify unique individuals, and the sampling mechanism is unknown. Even with one record per Soldier, Soldiers share companies and battalions, where common conditions may correlate scores. The Skill Level 1 records cover 24 companies in five battalions. The standard intervals and p-values are nominal and may overstate precision. As a descriptive sensitivity check, omitting one battalion at a time left the early mean between 27.09 and 27.18 and the group gap between 3.75 and 4.57 hits. Five battalions give limited information for cluster-level inference. The omission check measures stability and supplies no cluster-adjusted confidence interval.
with(same_skill, table(battalion, years >= 4))
##
## battalion FALSE TRUE
## 1-26 AV 233 40
## 2-16 AV 297 36
## 3-41 AV 222 23
## 4-77 GSAB 330 46
## HHB CAB 27 5
length(unique(same_skill$company))
## [1] 24
sapply(unique(same_skill$battalion), function(unit) {
keep <- subset(same_skill, battalion != unit)
early_mean <- mean(keep$m4[keep$years < 4])
c(early_mean = early_mean, gap = mean(keep$m4[keep$years >= 4]) - early_mean)
})
## 3-41 AV 1-26 AV 2-16 AV 4-77 GSAB HHB CAB
## early_mean 27.149944 27.090183 27.183498 27.145058 27.146026
## gap 4.251631 4.573454 3.746327 4.460711 4.164319
simple_fit <- lm(m4 ~ years, data = same_skill)
summary(simple_fit)
##
## Call:
## lm(formula = m4 ~ years, data = same_skill)
##
## Residuals:
## Min 1Q Median 3Q Max
## -9.7804 -2.7961 -0.8687 2.5395 13.1903
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 23.80974 0.23387 101.81 <2e-16 ***
## years 1.63578 0.08783 18.62 <2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 3.929 on 1257 degrees of freedom
## Multiple R-squared: 0.2163, Adjusted R-squared: 0.2157
## F-statistic: 346.9 on 1 and 1257 DF, p-value: < 2.2e-16
confint(simple_fit)["years", ]
## 2.5 % 97.5 %
## 1.463483 1.808084
plot(jitter(m4, amount = 0.15) ~ years, data = same_skill,
pch = 16, col = "#245A8066", xlab = "Years of active service",
ylab = "Recorded M4 hits", main = "CAB Soldiers at Skill Level 1")
abline(simple_fit, col = "#A1452A", lwd = 2)
Within CAB Skill Level 1, each additional service year was associated with 1.64 more predicted hits on average under the fitted line (nominal 95% CI 1.46 to 1.81, p < .001, R² = 0.216). This is a cross-sectional comparison of Soldiers with different service times.
Service years is the main predictor and stays continuous. Skill level is categorical and accounts for differences across levels while estimating a common service-year slope within a level. Age accounts for differences between Soldiers of different ages who have the same tenure and skill level. Skill level and age overlap with years of service, so I checked both the service ranges and variance inflation factors (VIFs). If service time affects skill level, the coefficient describes a conditional association at a fixed level.
model_data <- subset(clean, !is.na(age))
multiple_fit <- lm(m4 ~ years + age + skill_level, data = model_data)
summary(multiple_fit)
##
## Call:
## lm(formula = m4 ~ years + age + skill_level, data = model_data)
##
## Residuals:
## Min 1Q Median 3Q Max
## -11.1938 -3.0109 -0.5537 2.9236 12.5935
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 25.85126 0.47414 54.522 < 2e-16 ***
## years 1.24922 0.07398 16.887 < 2e-16 ***
## age -0.04558 0.01958 -2.328 0.020 *
## skill_levelSkill Level 2 -0.59239 0.37595 -1.576 0.115
## skill_levelSkill Level 3 -2.93717 0.66369 -4.426 1.01e-05 ***
## skill_levelSkill Level 4 -7.20683 1.06423 -6.772 1.67e-11 ***
## skill_levelSkill Level 5 -10.52196 1.55309 -6.775 1.64e-11 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 4.096 on 1970 degrees of freedom
## Multiple R-squared: 0.4226, Adjusted R-squared: 0.4208
## F-statistic: 240.3 on 6 and 1970 DF, p-value: < 2.2e-16
confint(multiple_fit)
## 2.5 % 97.5 %
## (Intercept) 24.92139074 26.781137595
## years 1.10413669 1.394296403
## age -0.08397429 -0.007184268
## skill_levelSkill Level 2 -1.32968481 0.144910289
## skill_levelSkill Level 3 -4.23877460 -1.635560758
## skill_levelSkill Level 4 -9.29396399 -5.119693782
## skill_levelSkill Level 5 -13.56783701 -7.476090208
aggregate(years ~ skill_level, model_data,
function(x) c(n = length(x), min = min(x), max = max(x)))
## skill_level years.n years.min years.max
## 1 Skill Level 1 1259.000 0.000 6.544
## 2 Skill Level 2 397.000 3.164 10.668
## 3 Skill Level 3 225.000 6.713 15.000
## 4 Skill Level 4 75.000 11.615 19.691
## 5 Skill Level 5 21.000 18.900 20.667
cor(model_data$years, model_data$age)
## [1] 0.6549159
predictors <- model.matrix(multiple_fit)[, -1, drop = FALSE]
diag(solve(cor(predictors))) # VIFs for the numeric predictors and each dummy column
## years age skill_levelSkill Level 2
## 11.307218 1.767958 2.673416
## skill_levelSkill Level 3 skill_levelSkill Level 4 skill_levelSkill Level 5
## 5.236121 4.871988 2.987756
par(mfrow = c(2, 2))
plot(multiple_fit, which = c(1, 2, 3, 4))
par(mfrow = c(1, 1))
cook <- cooks.distance(multiple_fit)
top <- head(order(cook, decreasing = TRUE), 5)
cbind(model_data[top, c("csv_row", "skill_level", "years", "age", "m4")],
cooks_distance = cook[top])
## csv_row skill_level years age m4 cooks_distance
## 23926 23926 Skill Level 4 19.691 37 32 0.01466116
## 31264 31264 Skill Level 5 20.667 39 34 0.01297983
## 18142 18142 Skill Level 4 11.615 33 40 0.01143907
## 389 389 Skill Level 3 15.000 32 29 0.01133539
## 8063 8063 Skill Level 4 15.708 40 27 0.01058985
sum(cook > 4 / nobs(multiple_fit))
## [1] 79
coef(update(multiple_fit, data = model_data[-which.max(cook), ]))["years"]
## years
## 1.261445
sapply(unique(model_data$battalion), function(unit) {
coef(update(multiple_fit, data = subset(model_data, battalion != unit)))["years"]
})
## 3-41 AV.years 1-26 AV.years 2-16 AV.years 4-77 GSAB.years HHB CAB.years
## 1.275714 1.241823 1.249568 1.249069 1.237776
The residual-versus-fitted plot shows curvature, with mean residuals of roughly −0.82, +0.44, +0.61 and −0.23 hits across fitted-value quartiles. Residual SDs range from 3.24 to 4.63 across the quartiles, suggesting uneven variance. The Q–Q plot departs from its reference line in the tails, consistent with bounded scores and mild right skew. Some fitted values exceed 40. Treat the slope as a summary of the average association over observed service times.
Cook’s distance flagged 79 observations using the exploratory \(4/n\) cutoff. The largest was CSV data row 23,926 (Cook’s D = 0.0147), with 19.691 years at Skill Level 4 and an M4 score of 32. Omitting that record moved the slope from 1.249 to 1.261 hits per year. I retained the observation. Omitting one battalion at a time gave slopes of 1.24 to 1.28 hits per year. Standard regression intervals remain nominal given the nesting and residual diagnostics.
CAB Soldiers with more service time had higher recorded M4 scores within Skill Level 1, and the estimated common within-level association remained positive after accounting for age across the five recorded skill levels. Observational comparisons across Soldiers cannot establish how one Soldier’s score would change with another year of service. Differences in prior experience, training, unit conditions, or which records had complete data could contribute to the association. The results describe the synthetic CAB dataset.