楼主: longjun890521
1567 1

[一般统计问题] 如何做联立表格 [推广有奖]

  • 0关注
  • 2粉丝

博士生

20%

还不是VIP/贵宾

-

威望
0
论坛币
11 个
通用积分
1.0361
学术水平
0 点
热心指数
0 点
信用等级
0 点
经验
200 点
帖子
57
精华
0
在线时间
355 小时
注册时间
2012-5-10
最后登录
2020-11-27

楼主
longjun890521 发表于 2015-3-29 11:21:10 |AI写论文
5论坛币


根据变量1(abcd)和变量2(ABCD)算收入的平均值



a b c d
A
B
C
D

关键词:ABCD ABC 平均值 如何

沙发
蓝色 发表于 2015-3-29 16:51:15
看 table 命令
Examples

    -----------------------------------------------------------------------------------------------------------------
    Setup
        . sysuse auto

    One-way table; frequencies shown by default
        . table rep78

    One-way table; show count of nonmissing observations for mpg
        . table rep78, contents(n mpg)

    One-way table; multiple statistics on mpg requested
        . table rep78, c(n mpg mean mpg sd mpg median mpg)

    Add formatting
        . table rep78, c(n mpg mean mpg sd mpg median mpg) format(%9.2f)

    Two-way table; frequencies shown by default
        . table rep78 foreign

    Two-way table; show means of mpg for each cell
        . table rep78 foreign, c(mean mpg)

    Add formatting
        . table rep78 foreign, c(mean mpg) format(%9.2f) center
        . table foreign rep78, c(mean mpg) format(%9.2f) center

    Add row and column totals
        . table foreign rep78, c(mean mpg) format(%9.2f) center row col

    -----------------------------------------------------------------------------------------------------------------
    Setup
        . webuse byssin

    Three-way table
        . table workplace smokes race [fw=pop], c(mean prob)

    Add formatting
        . table workplace smokes race [fw=pop], c(mean prob) format(%9.3f)

    Request supercolumn totals
        . table workplace smokes race [fw=pop], c(mean prob) format(%9.3f) sc

    -----------------------------------------------------------------------------------------------------------------
    Setup
        . webuse byssin1

    Four-way table
        . table workplace smokes race [fw=pop], by(sex) c(mean prob) format(%9.3f)

    Four-way table with supercolumn, row, and column totals
        . table workplace smokes race [fw=pop], by(sex) c(mean prob) format(%9.3f) sc col row
    -----------------------------------------------------------------------------------------------------------------

已有 1 人评分经验 收起 理由
SpencerMeng + 100 观点有启发

总评分: 经验 + 100   查看全部评分

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注jltj
拉您入交流群
GMT+8, 2026-1-4 05:41