-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error: Stratification variable(s) should not contain missing values. #97
Comments
I'm sorry for introducing this change that broke your code. It was done in response to feedback from another user (#80). But I obviously hadn't considered your use case and maybe I acted too hastily. In order to help you, I would need a concrete example that I can reproduce. Would it be possible to provide such an example using some simulated data? |
Dear Benjamin, Thank you for your help, I'm grateful. Here is a reproducible example: `s1_vars.NA <- c() s1_rndr <- function(x, name, ...) { table1(~ Sepal.Length + Petal.Length | Species, data=iris, render=s1_rndr, topclass = "Rtable1-zebra", render.missing=NULL, extra.col=list( Kind regards |
I'm looking at your example. I see that there are 3 strata (3 species), but I don't understand how you want the output to look. Are you trying to create 3 different p-values for each pairwise comparison? |
Hi Benjamin. My aim is to make a table with all the 3 strata, a total column, and a column with all the p-values (strata 1 vs 2, 1 vs 3 and 2 vs 3). What i've done so far to achieve this is create 4 different tables that i later merge manually: In the first 3, I will run one strata to the other (i.e. strata 1 vs 2, 1 vs 3 and 2 vs 3) to get the p values. In the 4th table, I will only run for the descriptives and not ask for p-values. However, it would definitely be great if it was possible to get all of this in one table. But if not, it would be great if i can again do as detailed above. I was able to do a work-around in whcih i create new darabases for each strata set of 2, ie one strata_1_vs_2-database for that table, strata_1_vs_3-database for that table and so forth. But it would be better if it worked as originally :-) Kind regards |
Dear Benjamin, Im having the same issue as Beduiz .. It would be great if you could do something about it.. :) best regards |
Hi, also having this problem - is there a suggested alterative or workaround when your stratified variable has some missing values? |
Hi all, I have the same problem. I was using renv to keep my packages the same, but now I decided to do an update and this issue broke all my tables. Most other crosstable packages can deal with NAs. Maybe make it an option to set missing as a separate category? |
Dear Benjamin,
Since I last used table1 in the autumn, code that used to work does no longer with the following error presented:
The startification variable I use has 3 levels (for example 1 car, 2 cars and 3 cars), and since I can't get P-values with more than 2 levels, I've created custom stratification variables (stratification_12 with only 1 car and 2 car, stratification 13 with only 1 car and 3 cars, and stratification 23 with only 2 cars and 3 cars), in which the level not included has been replaced with NA. This used to work, but now doesn't.
is there a workaround?
Kind regards
The text was updated successfully, but these errors were encountered: