Creates the model specifications for xname
make_xname(yname, xnames, user_model, current_age, hat = NULL)
String indicating the dependent variable
Character vector of available names to choose from.
It is assumed all variables named in xnames
have complete
data. Any brokenstick variable should have names like
paste(yname, d, sep = "_")
, where d
is a vector
contuining decimal ages.
Model number (1-4), indicating type of model the user wants. See details.
Current age (in decimal years)
A list with brokenstick prediction for the target that
contains the names of the brokenstick proedictions. The entry is
NULL
if these estimates cannot be made. In that case, this
function does not include the previous yname scores into the
matching.
A character vector with the xname
specification
xnames <- c(
"sex", "ga", "bw", "hgt_0", "hgt_1", "hgt_3",
"wgt_0", "wgt_1", "wgt_2", "junk"
)
# note that it does not return hgt2
chartplotter:::make_xname(
yname = "hgt", xnames = xnames, user_model = 2,
current_age = 2
)
#> [1] "sex"