chrisadolph/tile-simcf — Issue #18: Automatic simcf (and tile?)
Author: chrisadolph
Created: 2012-01-29 20:48:25+00:00
State: open

When I use simcf in my own work, I usually write a long helper function to which I pass my formula and data. The helper function looks through the formula, and then has a series of ```if()``` statements which check for each possible covariate that could appear in the model, and, if present, adds a new scenario for that covariate to the cf object. This gets complex if there are potentially interaction terms, so inside that if statement are sub-```if()``` statements which check for possible interactions. It also gets complex when there are categorical or compositional variables, which need to be set in logically consistent ways. In the end, this function basically is sorting all covariates into continuous, binary, categorical, ordered, and compositional piles, and creating appropriate first difference counterfactuals (repectively: mean to mean +1 sd, 0 to 1, mean to each category or baseline to each other category, mean composition to ratio-preserving counterfactual, etc.).

We want a function which, given a formula and dataframe, and some tips on what is categorical, ordered, or compositional, does this automagically. When I do this for my own projects, I spend little time messing around with ```cfChange()``` code, which gets written for me.

Once we have an automagic simcf function, writing automagic ropeladder code to go with it should be much easier.

All this will be hard, but will be the core of our second release of tile+simcf to CRAN.