将演绎器的列联表导出为 csv 或 xls
我正在使用 JGR 并使用 Deducer,并且我正在使用 Deducer 创建列联表和频率。我最感兴趣的是导出这些列联表并将它们保存为 .csv 或 xls 文件。
出于我的目的,我不需要卡方或类似的东西,只需要交叉表和总计。当然,越简单越好,但任何帮助将不胜感激。
这是一般代码和输出的样子(来自 Hmisc 表创建)
Cell Contents
|-------------------------|
| Count |
| Row Percent |
| Column Percent |
|-------------------------|
Total Observations in Table: 524
| asq[, 23]
asq[, 4] | 1 | 2 | 3 | 4 | 5 | Row Total |
-------------|-----------|-----------|-----------|-----------|-----------|-----------|
0 | 76 | 54 | 93 | 46 | 54 | 323 |
| 23.529% | 16.718% | 28.793% | 14.241% | 16.718% | 61.641% |
| 54.286% | 56.250% | 63.265% | 63.889% | 78.261% | |
-------------|-----------|-----------|-----------|-----------|-----------|-----------|
1 | 64 | 42 | 54 | 26 | 15 | 201 |
| 31.841% | 20.896% | 26.866% | 12.935% | 7.463% | 38.359% |
| 45.714% | 43.750% | 36.735% | 36.111% | 21.739% | |
-------------|-----------|-----------|-----------|-----------|-----------|-----------|
Column Total | 140 | 96 | 147 | 72 | 69 | 524 |
| 26.718% | 18.321% | 28.053% | 13.740% | 13.168% | |
-------------|-----------|-----------|-----------|-----------|-----------|-----------|
谢谢!
I am working with JGR and using Deducer, and I am creating contingency tables and frequencies using Deducer. I'm mostly interested in exporting these contingency tables and saving them as .csv or xls files.
For my purposes, I don't need the chi-sq or anything like that, just the cross tabs and totals. Of course, the easier the better, but any help would be greatly appreciated.
Here's what the general code and output looks like (coming from Hmisc Table Creation)
Cell Contents
|-------------------------|
| Count |
| Row Percent |
| Column Percent |
|-------------------------|
Total Observations in Table: 524
| asq[, 23]
asq[, 4] | 1 | 2 | 3 | 4 | 5 | Row Total |
-------------|-----------|-----------|-----------|-----------|-----------|-----------|
0 | 76 | 54 | 93 | 46 | 54 | 323 |
| 23.529% | 16.718% | 28.793% | 14.241% | 16.718% | 61.641% |
| 54.286% | 56.250% | 63.265% | 63.889% | 78.261% | |
-------------|-----------|-----------|-----------|-----------|-----------|-----------|
1 | 64 | 42 | 54 | 26 | 15 | 201 |
| 31.841% | 20.896% | 26.866% | 12.935% | 7.463% | 38.359% |
| 45.714% | 43.750% | 36.735% | 36.111% | 21.739% | |
-------------|-----------|-----------|-----------|-----------|-----------|-----------|
Column Total | 140 | 96 | 147 | 72 | 69 | 524 |
| 26.718% | 18.321% | 28.053% | 13.740% | 13.168% | |
-------------|-----------|-----------|-----------|-----------|-----------|-----------|
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在 Deducer 中没有特别好的方法来做到这一点(尽管也许应该有)。如果您使用 DeducerRichOutput,则表格格式为 html,并且可以复制/粘贴到 Excel 中。您可以使用以下命令安装它:
如果您想以编程方式执行此操作,最好使用基本 R。
There is not a particularly good way to do this in Deducer (though perhaps there should be). If you are using DeducerRichOutput then tables are formatted as html and can be copy/pasted into excel. You can install it with:
If you want to do this programatically, you are best off using base R.