I am getting Inf. output for $y when running a box cox transformation using the MASS package. Here is a sample of the code I am running:
sb2<- as.formula("yes~no+insured+sex2+racethx+mnhlth53+rthlth53+age13x")
meps_analytic2 %>%
filter(as.logical(yes))%>%
MASS::boxcox(sb2,lambda=seq(-1,1,len=5),plotit=FALSE,data=.)
$x
[1] -1.0 -0.5 0.0 0.5 1.0
$y
[1] Inf Inf Inf Inf Inf
> summary(meps_analytic2)
age13x racethx mnhlth53 rthlth53 sex2 no yes
19 : 579 1: 7792 1:9329 1:6252 0:13967 FALSE: 1875 FALSE:24304
26 : 559 2:10196 2:7354 2:8163 1:12212 TRUE :24304 TRUE : 1875
22 : 539 3: 5435 3:7187 3:7759
21 : 534 4: 2094 4:1887 4:3125
25 : 533 5: 662 5: 422 5: 880
29 : 533
(Other):22902
insured
0: 7264
1:18915
I've tried running is.finite()
and is.nan()
for all variables that make up sb2
, but no infinite values or NaNs are found. What would cause me to keep getting Inf
responses for $y?? I have also tried changing class of variables to as.logical, as.numeric, etc.