-
Notifications
You must be signed in to change notification settings - Fork 3
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
Test statistic not showing any longer #48
Comments
There has been some debate and back and forth about the test statistic present / absence. Add Other things, the id is now pulled from the R chuck id if possible if you're using Rmarkdown. Also if you just call it in a chuck (i.e. drop assignment and later render call) it will autodetect if it's being called from Rmarkdown and find the right renderer to use, so a document will compile to either PDF or HTML with no code changes. I've also added documentation for the transforms, for example |
Sweet thank you! I tend to write my analyses and output independent results (tables, figures). Just haven't found a good resource to get into rmarkdown workflow. Would love to integrate with versioning/git. Again, this package is awesome. I will have to write my own function for test statistics....have a project that uses propensity matching. Will want matching-appropriate comparisons. All the best! |
I want to add more transforms. I will write the guts of it if you provide me an Rmd file showing the table layout you desire, the types to compare. I do have one currently that was contributed |
Boom. Finally got around to it. Here is Rmd: https://github.com/kylerove/tangram_psm Everything appears to work well and runs without errors, but the tables won't display because:
This probably has something to do with the table-building code. Anyway, let me know what you think. I hope we can get this working soon! |
That warning is interesting. It's saying the the type detection is failing and it's trying to coerce a list to logical. Should be a minor tweak. |
This is odd, because sex and lang work individually and technically should have no interaction in the code as it pastes them together after running separately. This means that some global variable is leaking between the two.
|
Yeah, I'm not super adept at debugging tools in R. I usually resort to print() statements to narrow down lines that might be generating the issue. This one though, stumped me because no actual error comes out until you try to display the result. |
Okay, there's a lot to unpack on this one. First the fix is easy. Change line 424 in Matched cohort stats from So the error message you got was because the sub-tables didn't line up. I had the same problem and fixed it in the original you copied from. I see several things that should happen because of this:
|
Please feel free to use the code and modify/simplify as needed to meet the end goals. I figured it was related to the table generation but couldn’t see the issue. Nice work!
… On Sep 20, 2019, at 10:06 AM, Shawn Garbett ***@***.***> wrote:
Okay, there's a lot to unpack on this one. First the fix is easy.
Change line 424 in Matched cohort stats from add_col to add_row.
So the error message you got was because the sub-tables didn't line up. I had the same problem and fixed it in the original you copied from.
I see several things that should happen because of this:
The error message needs to be descriptive to triage the problem faster. This was a really simple problem once it was obvious what it was. However logical conversion issues are nonsensical. So I'm going to add much better error handling that checks for miss specified transforms.
There is a huge amount of boiler plate code copied over to meet your end goal. It would be far better that only the necessary overrides were required, making this use case much simpler to implement. However, kudos for diving into the deep end. I will work on turning this into a much simpler method that makes the same tables.
I'd like to include this use-case as another available transform for users. Do I have your permission to use this code and include you as a contributing author?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
I made an error in my mapping of the various comparison contingencies (numerical x categorical, etc). I didn't realize it. Because the only valid options for comparison should be numerical x cat and cat x cat, I have removed the other contingency options within The function Anyway, look forward to integrating this transform into your package. |
I found a simple fix to prevent this issue from being a problem. Going to close this bug ticket and open an enhancement for the other issues. |
I don't know when this changed, but its been a few months since I ran my code. Now it is not showing the test statistic column. I tried with no transform, hmisc, my own transform. What am I missing?
table1 <- tangram(group ~ age[2] + sex + height[1] + weight[1] + bmi[4] + bmi_z[2] + tmi[6] + race + language + insurance + distance[1] + match_vp_shunt + match_spina_dx + match_past_surgery + neurologic_lesion + neurologic_lesion_level + match_ambulation + diagnosis_1 , data=recordsData, transform=hmisc, id="table1")
The text was updated successfully, but these errors were encountered: