NAs get switched for first category when working with multiple connections that don't have NAs

Hi, I am running analyses on multiple studies and am particularly interested in BMI, for which I created both a categorical variable and dummy variables (for normal, overweight and obesity). We have missings (NA) in only one study (Study A), which correctly remain as missings in the categorical and dummy variables when I only work on this connection. However, when I want to check the table of frequencies (both with the categorical and dummy variables) in all studies, the missings from Study A show as the first level/category instead of the true frequencies (which just disappear from the table). Because the other studies have one fewer category (no NAs), I get the warning message “Warning in etas == tss: longer object length is not a multiple of shorter object length”. Is there a way to force an NA level for the studies without NAs, and/or a way for my observations in the first category NOT to be exchanged for the NAs? I have tried ds.recodeValues and ds.replaceNAs without success. I am attaching two screenshots, one for the result only with Study A (correct categories), and with all studies (Study A categories wrong).

Thanks a lot for your time and help. Best, Carolina

Hi Carolina,

In which version of dsBase you get this issue (you can check this if you do datashield.pkg_status(opals))? There was an issue in an earliest version of the ds.table function with the default useNA option. This issue was fixed in version 6.1.1 I think. But if you are using an earliest version, I suggest you to use either the argument useNA=‘always’ or useNA=‘no’ in the ds.table function.

The warning message is not an issue, it is just saying that not all the studies have data in all categories (See for example the first study does not have data in category 3).

Thank you, Demetris, for your reply. I am using version 6.1.1. I ran it with the argument useNA=‘no’ and worked well, so I will keep this in mind if I run into this issue again.

Best, Carolina