aalfons / robmedExtra

Shiny apps for (robust) mediation analysis via package robmed
GNU General Public License v3.0
1 stars 1 forks source link

Table footnote with categorical control variable #21

Closed VLDrenth closed 1 year ago

VLDrenth commented 1 year ago

When using a categorical variable as Covariate in the model, the control variables mentioned in the table's footnote are named with the levels of that variable. When using Species as Covariate, the control variables are: ‘Speciesversicolor, Speciesvirginica’. When the control variable has many levels this might get very long. Would it not be sufficient to only mention the name of the categorical variable, in this case Species, as control variable?

aalfons commented 1 year ago

From a technical perspective, this may be difficult to implement, because the current implementation relies on how R handles categorical variables in regression models to first convert the categorical variables, then calls a workhorse function with the converted dummy variables. This is standard practice for modeling functions in R.

Moreover, it's important that we store the object stores variables that are actually used in the regressions (i.e., the dummy variables), otherwise things get very messy when extracting the relevant coefficients to present in the output or the table of results.

Finally, listing the dummy variables is more accurate and provides the user with more information, namely which specific dummy variables are used in the regressions.

For these reasons, I'll keep the functionality as is.