# fit a linear regression model with continuous outcome and predictor
mod = lm(charges ~ age, data = RESI::insurance)
# obtain t value for calculating RESI
t = summary(mod)$coefficients[2, "t value"]
# calculate RESI
S = t2S(t, n = 1338, rdf = 1336)
# convert to f^2
S2fsq(S)
Run the code above in your browser using DataLab