assign_df {mfp2} | R Documentation |
Helper to assign degrees of freedom
Description
Determine the number of unique values in a variable. To be used in mfp2()
.
Usage
assign_df(x, df_default = 4)
Arguments
x |
input matrix. |
df_default |
default df to be used. Default is 4. |
Details
Variables with fewer than or equal to three unique values, for example, will be assigned df = 1. df = 2 will be assigned to variables with 4-5 unique values, and df = 4 will be assigned to variables with unique values greater than or equal to 6.
Value
Vector of length ncol(x)
with degrees of freedom for each variable in x
.
Examples
x <- matrix(1:100, nrow = 10)
assign_df(x)
[Package mfp2 version 1.0.0 Index]