PcAux-Package / PcAux

This is the repository for the PcAux project.
GNU General Public License v3.0
4 stars 5 forks source link

Unintended feature with interactType #20

Closed ppanko closed 6 years ago

ppanko commented 6 years ago

The createPcAux function in version 0.0.0.9012 returns the following warning when specifying interactType = 0:

Warning: 
You have specified 'interactType = 1' without specifying any moderators, so I
will incorporate all pairwise interactions among the observed variables into the
initial imputation model.

Fortunately, the behavior outlined in the warning is not forced on the user in this case so the interactType functionality seems to be working as intended. The warning occurs due to the check that happens on lines 65-69, or more specifically, line 68, which looks like this:

if(pcAuxData$intMeth < 3) warnFun("noMods")

I would suggest changing this line to the following:

if(pcAuxData$intMeth == 1| pcAuxData$intMeth == 2) warnFun("noMods")

This script should solve the issue with the false warning and is roughly twice as fast as when using %in% for the same operation.