全部版块 我的主页
论坛 计量经济学与统计论坛 五区 计量经济学与统计软件 Stata专版
8950 9
2009-07-28
听说Stata不如SPSS的地方之一就是它的方差分析功能较弱,比如,SPSS的方差分析功能(不包括oneway)后有一系列多重比较选项,当然最常用的是S-N-K啦,而Stata就只能给出一个总体有无差异的结论,俺找了半天,貌似Stata的anona命令下没有多重比较功能哦。
到底有没有?大牛们解释一下?如果需要自编命令,如何实现?
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

全部回复
2009-7-29 00:01:36
不好意思,正文中打错了一个字母:anona应该为anova.
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2009-7-29 10:45:53
help oneway                                                     dialog:  oneway
-------------------------------------------------------------------------------

Title

    [R] oneway -- One-way analysis of variance


Syntax

        oneway response_var factor_var [if] [in] [weight] [, options]

    options           description
    -------------------------------------------------------------------------
    Main
      bonferroni      Bonferroni multiple-comparison test
      scheffe         Scheffe multiple-comparison test
      sidak           Sidak multiple-comparison test
      tabulate        produce summary table
      [no]means       include or suppress means; default is means
      [no]standard    include or suppress standard deviations; default is
                        standard
      [no]freq        include or suppress frequencies; default is freq
      [no]obs         include or suppress number of obs; default is obs if
                        data are weighted
      noanova         suppress the ANOVA table
      nolabel         show numeric codes, not labels
      wrap            do not break wide tables
      missing         treat missing values as categories
    -------------------------------------------------------------------------
    by is allowed; see [D] by.
    aweights and fweights are allowed; see weight.


Description

    The oneway command reports one-way analysis-of-variance (ANOVA) models
    and performs multiple-comparison tests.

    If you wish to fit more complicated ANOVA layouts or wish to fit
    analysis-of-covariance (ANOCOVA), see [R] anova.

    See [D] encode for examples of fitting ANOVA models on string variables.

    See [R] loneway for an alternative oneway with slightly different
    features.


Options

        +------+
    ----+ Main +-------------------------------------------------------------

    bonferroni reports the results of a Bonferroni multiple-comparison test.

    scheffe reports the results of a Scheffe multiple-comparison test.

    sidak reports the results of a Sidak multiple-comparison test.

    tabulate produces a table of summary statistics of the response_var by
        levels of the factor_var.  The table includes the mean, standard
        deviation, frequency, and, if the data are weighted, the number of
        observations.  Individual elements of the table may be included or
        suppressed by the [no]means, [no]standard, [no]freq, and [no]obs
        options.  For example, typing

            . oneway response factor, tabulate means standard

        produces a summary table that contains only the means and standard
        deviations.  You could achieve the same result by typing

            . oneway response factor, tabulate nofreq

    [no]means includes or suppresses only the means from the table produced
        by the tabulate option.  See tabulate above.

    [no]standard includes or suppresses only the standard deviation from the
        table produced by the tabulate option.  See tabulate above.

    [no]freq includes or suppresses only the frequencies from the table
        produced by the tabulate option.  See tabulate above.

    [no]obs includes or suppresses only the reported number of observations
        from the table produced by the tabulate option.  If the data are not
        weighted, only the frequency is reported.  If the data are weighted,
        the frequency refers to the sum of the weights.  See tabulate above.

    noanova suppresses the display of the ANOVA table.

    nolabel causes the numeric codes to be displayed rather than the value
        labels in the ANOVA and multiple-comparison test tables.

    wrap requests that Stata not break up wide tables to make them readable.

    missing requests that missing values of factor_var be treated as a
        category rather than as observations to be omitted from the analysis.


Examples

    ---------------------------------------------------------------------------
    Setup
        . webuse apple
        . oneway weight treatment

    Obtaining observed means
        . oneway weight treatment, tabulate

    Bonferroni multiple-comparison test
        . oneway weight treatment, bonferroni

    Scheffe multiple-comparison test
        . oneway weight treatment, scheffe

    ---------------------------------------------------------------------------
    Setup
        . webuse census8

    With weighted data
        . oneway drate region [w=pop]
    ---------------------------------------------------------------------------


Saved results

    oneway saves the following in r():

    Scalars   
      r(N)           number of observations
      r(F)           F statistic
      r(df_r)        within-group degrees of freedom
      r(mss)         between-group sum of squares
      r(df_m)        between-group degrees of freedom
      r(rss)         within-group sum of squares
      r(chi2bart)    Bartlett's chi-squared
      r(df_bart)     Bartlett's degrees of freedom


Also see

    Manual:  [R] oneway

    Online:  [R] anova, [R] loneway
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2009-7-29 10:46:43
可见提供了三种两两比较的方法:
  bonferroni      Bonferroni multiple-comparison test
      scheffe         Scheffe multiple-comparison test
      sidak           Sidak multiple-comparison test
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2009-7-29 19:12:27
比较而言,spss的方差分析能力更强大……
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2009-7-29 20:19:15
chyshl 发表于 2009-7-28 23:57
听说Stata不如SPSS的地方之一就是它的方差分析功能较弱,比如,SPSS的方差分析功能(不包括oneway)后有一系列多重比较选项,当然最常用的是S-N-K啦,而Stata就只能给出一个总体有无差异的结论,俺找了半天,貌似Stata的anona命令下没有多重比较功能哦。
到底有没有?大牛们解释一下?如果需要自编命令,如何实现?
你说的是多重比较检验吧?Stata只内置了三种:
      bonferroni      Bonferroni multiple-comparison test
      scheffe         Scheffe multiple-comparison test
      sidak           Sidak multiple-comparison test

如果想使用LSD、S-N-K其他检验方法可以考虑使用Spss软件
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

点击查看更多内容…
相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群