Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Bartlett test

    Hi everyone,
    kindly I need to know the command of Bartlett test.
    can someone help me please?
    kindest,

  • #2
    At the command line in Stata, type
    Code:
    search Bartlett

    Comment


    • #3
      Alkebee:
      do you mean something along the following lines?
      Code:
      use "C:\Program Files\Stata16\ado\base\a\auto.dta"
      
      . oneway price rep78, bonferroni
      
                              Analysis of Variance
          Source              SS         df      MS            F     Prob > F
      ------------------------------------------------------------------------
      Between groups      8360542.63      4   2090135.66      0.24     0.9174
       Within groups       568436416     64      8881819
      ------------------------------------------------------------------------
          Total            576796959     68   8482308.22
      
      Bartlett's test for equal variances:  chi2(4) =  11.4252  Prob>chi2 = 0.022
      
                        Comparison of Price by Repair Record 1978
                                      (Bonferroni)
      Row Mean-|
      Col Mean |          1          2          3          4
      ---------+--------------------------------------------
             2 |    1,403.1
               |      1.000
               |
             3 |    1,864.7    461.608
               |      1.000      1.000
               |
             4 |      1,507    103.875   -357.733
               |      1.000      1.000      1.000
               |
             5 |    1,348.5    -54.625   -516.233     -158.5
               |      1.000      1.000      1.000      1.000
      
      .
      Bartlett's test is covered in -oneway- entry, Stata .pdf manual.
      Kind regards,
      Carlo
      (Stata 19.0)

      Comment


      • #4
        It is, indeed. You're not really limited to one-way ANOVA, though, if by "Bartlett test" the OP means NHST for heteroscedastic residuals. See below for a couple of alternative approaches that promise greater flexibility. (Despite them, I would be more inclined to examine residuals graphically for this.)

        .ÿ
        .ÿversionÿ16.1

        .ÿ
        .ÿlocalÿline_sizeÿ`c(linesize)'

        .ÿsetÿlinesizeÿ78

        .ÿ
        .ÿclearÿ*

        .ÿ
        .ÿsetÿseedÿ`=strreverse("1581296")'

        .ÿ
        .ÿquietlyÿsysuseÿauto

        .ÿsummarizeÿrep78,ÿmeanonly

        .ÿquietlyÿreplaceÿrep78ÿ=ÿruniformint(r(min),ÿr(max))ÿifÿmi(rep78)

        .ÿ
        .ÿonewayÿpriceÿrep78

        ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿAnalysisÿofÿVariance
        ÿÿÿÿSourceÿÿÿÿÿÿÿÿÿÿÿÿÿÿSSÿÿÿÿÿÿÿÿÿdfÿÿÿÿÿÿMSÿÿÿÿÿÿÿÿÿÿÿÿFÿÿÿÿÿProbÿ>ÿF
        ------------------------------------------------------------------------
        Betweenÿgroupsÿÿÿÿÿÿ10722949.6ÿÿÿÿÿÿ4ÿÿÿ2680737.41ÿÿÿÿÿÿ0.30ÿÿÿÿÿ0.8794
        ÿWithinÿgroupsÿÿÿÿÿÿÿ624342446ÿÿÿÿÿ69ÿÿÿ9048441.25
        ------------------------------------------------------------------------
        ÿÿÿÿTotalÿÿÿÿÿÿÿÿÿÿÿÿ635065396ÿÿÿÿÿ73ÿÿÿ8699525.97

        Bartlett'sÿtestÿforÿequalÿvariances:ÿÿchi2(4)ÿ=ÿÿ13.6115ÿÿProb>chi2ÿ=ÿ0.009

        .ÿ
        .ÿ/*ÿAnotherÿStataÿcommandÿtoÿconsider:ÿ*/
        .ÿhetregressÿpriceÿi.rep78,ÿhet(i.rep78)ÿlrmodelÿnolog

        HeteroskedasticÿlinearÿregressionÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿNumberÿofÿobsÿÿÿÿÿ=ÿÿÿÿÿÿÿÿÿ74
        MLÿestimation
        ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿLRÿchi2(4)ÿÿÿÿÿÿÿÿ=ÿÿÿÿÿÿÿ3.88
        Logÿlikelihoodÿ=ÿ-686.6222ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿProbÿ>ÿchi2ÿÿÿÿÿÿÿ=ÿÿÿÿÿ0.4219

        ------------------------------------------------------------------------------
        ÿÿÿÿÿÿÿpriceÿ|ÿÿÿÿÿÿCoef.ÿÿÿStd.ÿErr.ÿÿÿÿÿÿzÿÿÿÿP>|z|ÿÿÿÿÿ[95%ÿConf.ÿInterval]
        -------------+----------------------------------------------------------------
        priceÿÿÿÿÿÿÿÿ|
        ÿÿÿÿÿÿÿrep78ÿ|
        ÿÿÿÿÿÿÿÿÿÿ2ÿÿ|ÿÿÿÿ950.625ÿÿÿ1264.399ÿÿÿÿÿ0.75ÿÿÿ0.452ÿÿÿÿ-1527.551ÿÿÿÿ3428.801
        ÿÿÿÿÿÿÿÿÿÿ3ÿÿ|ÿÿÿ1412.233ÿÿÿÿ773.193ÿÿÿÿÿ1.83ÿÿÿ0.068ÿÿÿÿ-103.1971ÿÿÿÿ2927.664
        ÿÿÿÿÿÿÿÿÿÿ4ÿÿ|ÿÿÿÿÿÿ858.5ÿÿÿ582.5866ÿÿÿÿÿ1.47ÿÿÿ0.141ÿÿÿÿ-283.3488ÿÿÿÿ2000.349
        ÿÿÿÿÿÿÿÿÿÿ5ÿÿ|ÿÿÿÿ1485.75ÿÿÿ995.6854ÿÿÿÿÿ1.49ÿÿÿ0.136ÿÿÿÿ-465.7576ÿÿÿÿ3437.258
        ÿÿÿÿÿÿÿÿÿÿÿÿÿ|
        ÿÿÿÿÿÿÿ_consÿ|ÿÿÿÿÿÿÿ5017ÿÿÿ444.3134ÿÿÿÿ11.29ÿÿÿ0.000ÿÿÿÿÿ4146.162ÿÿÿÿ5887.838
        -------------+----------------------------------------------------------------
        lnsigma2ÿÿÿÿÿ|
        ÿÿÿÿÿÿÿrep78ÿ|
        ÿÿÿÿÿÿÿÿÿÿ2ÿÿ|ÿÿÿ2.652991ÿÿÿ.8660254ÿÿÿÿÿ3.06ÿÿÿ0.002ÿÿÿÿÿ.9556122ÿÿÿÿ4.350369
        ÿÿÿÿÿÿÿÿÿÿ3ÿÿ|ÿÿÿ2.722095ÿÿÿ.7527727ÿÿÿÿÿ3.62ÿÿÿ0.000ÿÿÿÿÿ1.246687ÿÿÿÿ4.197502
        ÿÿÿÿÿÿÿÿÿÿ4ÿÿ|ÿÿÿ1.279909ÿÿÿ.7745967ÿÿÿÿÿ1.65ÿÿÿ0.098ÿÿÿÿ-.2382722ÿÿÿÿ2.798091
        ÿÿÿÿÿÿÿÿÿÿ5ÿÿ|ÿÿÿ2.490359ÿÿÿ.8164966ÿÿÿÿÿ3.05ÿÿÿ0.002ÿÿÿÿÿ.8900556ÿÿÿÿ4.090663
        ÿÿÿÿÿÿÿÿÿÿÿÿÿ|
        ÿÿÿÿÿÿÿ_consÿ|ÿÿÿ13.57935ÿÿÿ.7071068ÿÿÿÿ19.20ÿÿÿ0.000ÿÿÿÿÿ12.19345ÿÿÿÿ14.96526
        ------------------------------------------------------------------------------
        LRÿtestÿofÿlnsigma2=0:ÿchi2(4)ÿ=ÿ16.92ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿProbÿ>ÿchi2ÿ=ÿ0.0020

        .ÿ
        .ÿ/*ÿYetÿsomethingÿelseÿtoÿthinkÿabout:ÿ*/
        .ÿmixedÿpriceÿi.rep78,ÿresiduals(independent,ÿby(rep78))ÿ///
        >ÿÿÿÿÿÿremlÿdfmethod(residual)ÿnolrtestÿnolog

        Mixed-effectsÿREMLÿregressionÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿNumberÿofÿobsÿÿÿÿÿ=ÿÿÿÿÿÿÿÿÿ74
        Groupÿvariable:ÿ_allÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿNumberÿofÿgroupsÿÿ=ÿÿÿÿÿÿÿÿÿÿ1

        ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿObsÿperÿgroup:
        ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿminÿ=ÿÿÿÿÿÿÿÿÿ74
        ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿavgÿ=ÿÿÿÿÿÿÿ74.0
        ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿmaxÿ=ÿÿÿÿÿÿÿÿÿ74
        DFÿmethod:ÿResidualÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿDF:ÿÿÿÿÿÿÿÿÿÿÿminÿ=ÿÿÿÿÿÿ69.00
        ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿavgÿ=ÿÿÿÿÿÿ69.00
        ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿmaxÿ=ÿÿÿÿÿÿ69.00

        ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿF(4,ÿÿÿÿ69.00)ÿÿÿÿ=ÿÿÿÿÿÿÿ0.98
        Logÿrestricted-likelihoodÿ=ÿ-649.53654ÿÿÿÿÿÿÿÿÿÿProbÿ>ÿFÿÿÿÿÿÿÿÿÿÿ=ÿÿÿÿÿ0.4255

        ------------------------------------------------------------------------------
        ÿÿÿÿÿÿÿpriceÿ|ÿÿÿÿÿÿCoef.ÿÿÿStd.ÿErr.ÿÿÿÿÿÿtÿÿÿÿP>|t|ÿÿÿÿÿ[95%ÿConf.ÿInterval]
        -------------+----------------------------------------------------------------
        ÿÿÿÿÿÿÿrep78ÿ|
        ÿÿÿÿÿÿÿÿÿÿ2ÿÿ|ÿÿÿÿ950.625ÿÿÿ1365.538ÿÿÿÿÿ0.70ÿÿÿ0.489ÿÿÿÿ-1773.548ÿÿÿÿ3674.798
        ÿÿÿÿÿÿÿÿÿÿ3ÿÿ|ÿÿÿ1412.233ÿÿÿ823.0665ÿÿÿÿÿ1.72ÿÿÿ0.091ÿÿÿÿ-229.7394ÿÿÿÿ3054.206
        ÿÿÿÿÿÿÿÿÿÿ4ÿÿ|ÿÿÿÿÿÿ858.5ÿÿÿÿ642.405ÿÿÿÿÿ1.34ÿÿÿ0.186ÿÿÿÿ-423.0629ÿÿÿÿ2140.063
        ÿÿÿÿÿÿÿÿÿÿ5ÿÿ|ÿÿÿÿ1485.75ÿÿÿÿ1062.72ÿÿÿÿÿ1.40ÿÿÿ0.167ÿÿÿÿ-634.3176ÿÿÿÿ3605.818
        ÿÿÿÿÿÿÿÿÿÿÿÿÿ|
        ÿÿÿÿÿÿÿ_consÿ|ÿÿÿÿÿÿÿ5017ÿÿÿ513.0478ÿÿÿÿÿ9.78ÿÿÿ0.000ÿÿÿÿÿ3993.498ÿÿÿÿ6040.502
        ------------------------------------------------------------------------------

        ------------------------------------------------------------------------------
        ÿÿRandom-effectsÿParametersÿÿ|ÿÿÿEstimateÿÿÿStd.ÿErr.ÿÿÿÿÿ[95%ÿConf.ÿInterval]
        -----------------------------+------------------------------------------------
        _all:ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ(empty)ÿ|
        -----------------------------+------------------------------------------------
        Residual:ÿIndependent,ÿÿÿÿÿÿÿ|
        ÿÿÿÿbyÿrep78ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ|
        ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ1:ÿvar(e)ÿ|ÿÿÿÿ1052872ÿÿÿ859680.3ÿÿÿÿÿÿ212501.2ÿÿÿÿÿ5216629
        ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ2:ÿvar(e)ÿ|ÿÿÿ1.28e+07ÿÿÿÿ6848199ÿÿÿÿÿÿÿ4493905ÿÿÿÿ3.65e+07
        ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ3:ÿvar(e)ÿ|ÿÿÿ1.24e+07ÿÿÿÿ3263388ÿÿÿÿÿÿÿ7427049ÿÿÿÿ2.08e+07
        ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ4:ÿvar(e)ÿ|ÿÿÿÿ2989323ÿÿÿ969864.2ÿÿÿÿÿÿÿ1582729ÿÿÿÿÿ5645976
        ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ5:ÿvar(e)ÿ|ÿÿÿ1.04e+07ÿÿÿÿ4431956ÿÿÿÿÿÿÿ4506333ÿÿÿÿ2.40e+07
        ------------------------------------------------------------------------------

        .ÿ//ÿWald
        .ÿquietlyÿtestÿ_b[r_lns2ose:_cons]ÿ=ÿ0,ÿnotest

        .ÿquietlyÿtestÿ_b[r_lns3ose:_cons]ÿ=ÿ0,ÿnotestÿaccumulate

        .ÿquietlyÿtestÿ_b[r_lns4ose:_cons]ÿ=ÿ0,ÿnotestÿaccumulate

        .ÿtestÿ_b[r_lns5ose:_cons]ÿ=ÿ0,ÿÿaccumulate

        ÿ(ÿ1)ÿÿ[r_lns2ose]_consÿ=ÿ0
        ÿ(ÿ2)ÿÿ[r_lns3ose]_consÿ=ÿ0
        ÿ(ÿ3)ÿÿ[r_lns4ose]_consÿ=ÿ0
        ÿ(ÿ4)ÿÿ[r_lns5ose]_consÿ=ÿ0

        ÿÿÿÿÿÿÿÿÿÿÿchi2(ÿÿ4)ÿ=ÿÿÿ19.09
        ÿÿÿÿÿÿÿÿÿProbÿ>ÿchi2ÿ=ÿÿÿÿ0.0008

        .ÿ//ÿLR
        .ÿestimatesÿstoreÿFull

        .ÿquietlyÿmixedÿpriceÿi.rep78,ÿremlÿdfmethod(residual)ÿnolrtestÿnolog

        .ÿlrtestÿFull

        Likelihood-ratioÿtestÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿLRÿchi2(4)ÿÿ=ÿÿÿÿÿ14.34
        (Assumption:ÿ.ÿnestedÿinÿFull)ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿProbÿ>ÿchi2ÿ=ÿÿÿÿ0.0063

        Note:ÿTheÿreportedÿdegreesÿofÿfreedomÿassumesÿtheÿnullÿhypothesisÿisÿnotÿon
        ÿÿÿÿÿÿtheÿboundaryÿofÿtheÿparameterÿspace.ÿÿIfÿthisÿisÿnotÿtrue,ÿthenÿthe
        ÿÿÿÿÿÿreportedÿtestÿisÿconservative.
        Note:ÿLRÿtestsÿbasedÿonÿREMLÿareÿvalidÿonlyÿwhenÿtheÿfixed-effects
        ÿÿÿÿÿÿspecificationÿisÿidenticalÿforÿbothÿmodels.

        .ÿ
        .ÿ/*ÿGivenÿthatÿyou'veÿgotÿit,ÿnowÿyouÿcanÿaccommodateÿitÿ.ÿ.ÿ.
        >ÿÿÿÿ.ÿ.ÿ.ÿandÿwithÿsmall-sampleÿtestÿstatistics,ÿtoÿboot.ÿÿ*/
        .ÿquietlyÿestimatesÿrestoreÿFull

        .ÿcontrastÿrep78,ÿsmallÿÿÿ

        Contrastsÿofÿmarginalÿlinearÿpredictions

        Marginsÿÿÿÿÿÿ:ÿasbalanced

        -----------------------------------------------------------
        ÿÿÿÿÿÿÿÿÿÿÿÿÿ|ÿÿÿÿÿÿÿÿÿdfÿÿÿÿÿÿÿÿddfÿÿÿÿÿÿÿÿÿÿÿFÿÿÿÿÿÿÿÿP>F
        -------------+---------------------------------------------
        priceÿÿÿÿÿÿÿÿ|
        ÿÿÿÿÿÿÿrep78ÿ|ÿÿÿÿÿÿÿÿÿÿ4ÿÿÿÿÿÿ69.00ÿÿÿÿÿÿÿÿ0.98ÿÿÿÿÿ0.4255
        -----------------------------------------------------------

        .ÿ
        .ÿsetÿlinesizeÿ`line_size'

        .ÿ
        .ÿexit

        endÿofÿdo-file


        .


        There are some user-written commands that are available for this, too, I think. (As well as for other things bearing the moniker.) That's why I recommended searching from within Stata.

        Comment


        • #5
          Originally posted by Carlo Lazzaro View Post
          Alkebee:
          do you mean something along the following lines?
          Code:
          use "C:\Program Files\Stata16\ado\base\a\auto.dta"
          
          . oneway price rep78, bonferroni
          
          Analysis of Variance
          Source SS df MS F Prob > F
          ------------------------------------------------------------------------
          Between groups 8360542.63 4 2090135.66 0.24 0.9174
          Within groups 568436416 64 8881819
          ------------------------------------------------------------------------
          Total 576796959 68 8482308.22
          
          Bartlett's test for equal variances: chi2(4) = 11.4252 Prob>chi2 = 0.022
          
          Comparison of Price by Repair Record 1978
          (Bonferroni)
          Row Mean-|
          Col Mean | 1 2 3 4
          ---------+--------------------------------------------
          2 | 1,403.1
          | 1.000
          |
          3 | 1,864.7 461.608
          | 1.000 1.000
          |
          4 | 1,507 103.875 -357.733
          | 1.000 1.000 1.000
          |
          5 | 1,348.5 -54.625 -516.233 -158.5
          | 1.000 1.000 1.000 1.000
          
          .
          Bartlett's test is covered in -oneway- entry, Stata .pdf manual.
          Yes it is.
          but did you use command (Bartlett oneway price rep78, bonferroni) or what?

          Comment


          • #6
            Originally posted by Joseph Coveney View Post
            It is, indeed. You're not really limited to one-way ANOVA, though, if by "Bartlett test" the OP means NHST for heteroscedastic residuals. See below for a couple of alternative approaches that promise greater flexibility. (Despite them, I would be more inclined to examine residuals graphically for this.)

            .ÿ
            .ÿversionÿ16.1

            .ÿ
            .ÿlocalÿline_sizeÿ`c(linesize)'

            .ÿsetÿlinesizeÿ78

            .ÿ
            .ÿclearÿ*

            .ÿ
            .ÿsetÿseedÿ`=strreverse("1581296")'

            .ÿ
            .ÿquietlyÿsysuseÿauto

            .ÿsummarizeÿrep78,ÿmeanonly

            .ÿquietlyÿreplaceÿrep78ÿ=ÿruniformint(r(min),ÿr(max))ÿifÿmi(rep78)

            .ÿ
            .ÿonewayÿpriceÿrep78

            ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿAnalysisÿofÿVariance
            ÿÿÿÿSourceÿÿÿÿÿÿÿÿÿÿÿÿÿÿSSÿÿÿÿÿÿÿÿÿdfÿÿÿÿÿÿMSÿÿÿÿÿÿÿÿÿÿÿÿFÿÿÿÿÿProbÿ>ÿF
            ------------------------------------------------------------------------
            Betweenÿgroupsÿÿÿÿÿÿ10722949.6ÿÿÿÿÿÿ4ÿÿÿ2680737.41ÿÿÿÿÿÿ0.30ÿÿÿÿÿ0.8794
            ÿWithinÿgroupsÿÿÿÿÿÿÿ624342446ÿÿÿÿÿ69ÿÿÿ9048441.25
            ------------------------------------------------------------------------
            ÿÿÿÿTotalÿÿÿÿÿÿÿÿÿÿÿÿ635065396ÿÿÿÿÿ73ÿÿÿ8699525.97

            Bartlett'sÿtestÿforÿequalÿvariances:ÿÿchi2(4)ÿ=ÿÿ13.6115ÿÿProb>chi2ÿ=ÿ0.009

            .ÿ
            .ÿ/*ÿAnotherÿStataÿcommandÿtoÿconsider:ÿ*/
            .ÿhetregressÿpriceÿi.rep78,ÿhet(i.rep78)ÿlrmodelÿnolog

            HeteroskedasticÿlinearÿregressionÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿNumberÿofÿobsÿÿÿÿÿ=ÿÿÿÿÿÿÿÿÿ74
            MLÿestimation
            ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿLRÿchi2(4)ÿÿÿÿÿÿÿÿ=ÿÿÿÿÿÿÿ3.88
            Logÿlikelihoodÿ=ÿ-686.6222ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿProbÿ>ÿchi2ÿÿÿÿÿÿÿ=ÿÿÿÿÿ0.4219

            ------------------------------------------------------------------------------
            ÿÿÿÿÿÿÿpriceÿ|ÿÿÿÿÿÿCoef.ÿÿÿStd.ÿErr.ÿÿÿÿÿÿzÿÿÿÿP>|z|ÿÿÿÿÿ[95%ÿConf.ÿInterval]
            -------------+----------------------------------------------------------------
            priceÿÿÿÿÿÿÿÿ|
            ÿÿÿÿÿÿÿrep78ÿ|
            ÿÿÿÿÿÿÿÿÿÿ2ÿÿ|ÿÿÿÿ950.625ÿÿÿ1264.399ÿÿÿÿÿ0.75ÿÿÿ0.452ÿÿÿÿ-1527.551ÿÿÿÿ3428.801
            ÿÿÿÿÿÿÿÿÿÿ3ÿÿ|ÿÿÿ1412.233ÿÿÿÿ773.193ÿÿÿÿÿ1.83ÿÿÿ0.068ÿÿÿÿ-103.1971ÿÿÿÿ2927.664
            ÿÿÿÿÿÿÿÿÿÿ4ÿÿ|ÿÿÿÿÿÿ858.5ÿÿÿ582.5866ÿÿÿÿÿ1.47ÿÿÿ0.141ÿÿÿÿ-283.3488ÿÿÿÿ2000.349
            ÿÿÿÿÿÿÿÿÿÿ5ÿÿ|ÿÿÿÿ1485.75ÿÿÿ995.6854ÿÿÿÿÿ1.49ÿÿÿ0.136ÿÿÿÿ-465.7576ÿÿÿÿ3437.258
            ÿÿÿÿÿÿÿÿÿÿÿÿÿ|
            ÿÿÿÿÿÿÿ_consÿ|ÿÿÿÿÿÿÿ5017ÿÿÿ444.3134ÿÿÿÿ11.29ÿÿÿ0.000ÿÿÿÿÿ4146.162ÿÿÿÿ5887.838
            -------------+----------------------------------------------------------------
            lnsigma2ÿÿÿÿÿ|
            ÿÿÿÿÿÿÿrep78ÿ|
            ÿÿÿÿÿÿÿÿÿÿ2ÿÿ|ÿÿÿ2.652991ÿÿÿ.8660254ÿÿÿÿÿ3.06ÿÿÿ0.002ÿÿÿÿÿ.9556122ÿÿÿÿ4.350369
            ÿÿÿÿÿÿÿÿÿÿ3ÿÿ|ÿÿÿ2.722095ÿÿÿ.7527727ÿÿÿÿÿ3.62ÿÿÿ0.000ÿÿÿÿÿ1.246687ÿÿÿÿ4.197502
            ÿÿÿÿÿÿÿÿÿÿ4ÿÿ|ÿÿÿ1.279909ÿÿÿ.7745967ÿÿÿÿÿ1.65ÿÿÿ0.098ÿÿÿÿ-.2382722ÿÿÿÿ2.798091
            ÿÿÿÿÿÿÿÿÿÿ5ÿÿ|ÿÿÿ2.490359ÿÿÿ.8164966ÿÿÿÿÿ3.05ÿÿÿ0.002ÿÿÿÿÿ.8900556ÿÿÿÿ4.090663
            ÿÿÿÿÿÿÿÿÿÿÿÿÿ|
            ÿÿÿÿÿÿÿ_consÿ|ÿÿÿ13.57935ÿÿÿ.7071068ÿÿÿÿ19.20ÿÿÿ0.000ÿÿÿÿÿ12.19345ÿÿÿÿ14.96526
            ------------------------------------------------------------------------------
            LRÿtestÿofÿlnsigma2=0:ÿchi2(4)ÿ=ÿ16.92ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿProbÿ>ÿchi2ÿ=ÿ0.0020

            .ÿ
            .ÿ/*ÿYetÿsomethingÿelseÿtoÿthinkÿabout:ÿ*/
            .ÿmixedÿpriceÿi.rep78,ÿresiduals(independent,ÿby(rep78))ÿ///
            >ÿÿÿÿÿÿremlÿdfmethod(residual)ÿnolrtestÿnolog

            Mixed-effectsÿREMLÿregressionÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿNumberÿofÿobsÿÿÿÿÿ=ÿÿÿÿÿÿÿÿÿ74
            Groupÿvariable:ÿ_allÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿNumberÿofÿgroupsÿÿ=ÿÿÿÿÿÿÿÿÿÿ1

            ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿObsÿperÿgroup:
            ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿminÿ=ÿÿÿÿÿÿÿÿÿ74
            ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿavgÿ=ÿÿÿÿÿÿÿ74.0
            ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿmaxÿ=ÿÿÿÿÿÿÿÿÿ74
            DFÿmethod:ÿResidualÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿDF:ÿÿÿÿÿÿÿÿÿÿÿminÿ=ÿÿÿÿÿÿ69.00
            ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿavgÿ=ÿÿÿÿÿÿ69.00
            ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿmaxÿ=ÿÿÿÿÿÿ69.00

            ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿF(4,ÿÿÿÿ69.00)ÿÿÿÿ=ÿÿÿÿÿÿÿ0.98
            Logÿrestricted-likelihoodÿ=ÿ-649.53654ÿÿÿÿÿÿÿÿÿÿProbÿ>ÿFÿÿÿÿÿÿÿÿÿÿ=ÿÿÿÿÿ0.4255

            ------------------------------------------------------------------------------
            ÿÿÿÿÿÿÿpriceÿ|ÿÿÿÿÿÿCoef.ÿÿÿStd.ÿErr.ÿÿÿÿÿÿtÿÿÿÿP>|t|ÿÿÿÿÿ[95%ÿConf.ÿInterval]
            -------------+----------------------------------------------------------------
            ÿÿÿÿÿÿÿrep78ÿ|
            ÿÿÿÿÿÿÿÿÿÿ2ÿÿ|ÿÿÿÿ950.625ÿÿÿ1365.538ÿÿÿÿÿ0.70ÿÿÿ0.489ÿÿÿÿ-1773.548ÿÿÿÿ3674.798
            ÿÿÿÿÿÿÿÿÿÿ3ÿÿ|ÿÿÿ1412.233ÿÿÿ823.0665ÿÿÿÿÿ1.72ÿÿÿ0.091ÿÿÿÿ-229.7394ÿÿÿÿ3054.206
            ÿÿÿÿÿÿÿÿÿÿ4ÿÿ|ÿÿÿÿÿÿ858.5ÿÿÿÿ642.405ÿÿÿÿÿ1.34ÿÿÿ0.186ÿÿÿÿ-423.0629ÿÿÿÿ2140.063
            ÿÿÿÿÿÿÿÿÿÿ5ÿÿ|ÿÿÿÿ1485.75ÿÿÿÿ1062.72ÿÿÿÿÿ1.40ÿÿÿ0.167ÿÿÿÿ-634.3176ÿÿÿÿ3605.818
            ÿÿÿÿÿÿÿÿÿÿÿÿÿ|
            ÿÿÿÿÿÿÿ_consÿ|ÿÿÿÿÿÿÿ5017ÿÿÿ513.0478ÿÿÿÿÿ9.78ÿÿÿ0.000ÿÿÿÿÿ3993.498ÿÿÿÿ6040.502
            ------------------------------------------------------------------------------

            ------------------------------------------------------------------------------
            ÿÿRandom-effectsÿParametersÿÿ|ÿÿÿEstimateÿÿÿStd.ÿErr.ÿÿÿÿÿ[95%ÿConf.ÿInterval]
            -----------------------------+------------------------------------------------
            _all:ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ(empty)ÿ|
            -----------------------------+------------------------------------------------
            Residual:ÿIndependent,ÿÿÿÿÿÿÿ|
            ÿÿÿÿbyÿrep78ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ|
            ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ1:ÿvar(e)ÿ|ÿÿÿÿ1052872ÿÿÿ859680.3ÿÿÿÿÿÿ212501.2ÿÿÿÿÿ5216629
            ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ2:ÿvar(e)ÿ|ÿÿÿ1.28e+07ÿÿÿÿ6848199ÿÿÿÿÿÿÿ4493905ÿÿÿÿ3.65e+07
            ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ3:ÿvar(e)ÿ|ÿÿÿ1.24e+07ÿÿÿÿ3263388ÿÿÿÿÿÿÿ7427049ÿÿÿÿ2.08e+07
            ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ4:ÿvar(e)ÿ|ÿÿÿÿ2989323ÿÿÿ969864.2ÿÿÿÿÿÿÿ1582729ÿÿÿÿÿ5645976
            ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ5:ÿvar(e)ÿ|ÿÿÿ1.04e+07ÿÿÿÿ4431956ÿÿÿÿÿÿÿ4506333ÿÿÿÿ2.40e+07
            ------------------------------------------------------------------------------

            .ÿ//ÿWald
            .ÿquietlyÿtestÿ_b[r_lns2ose:_cons]ÿ=ÿ0,ÿnotest

            .ÿquietlyÿtestÿ_b[r_lns3ose:_cons]ÿ=ÿ0,ÿnotestÿaccumulate

            .ÿquietlyÿtestÿ_b[r_lns4ose:_cons]ÿ=ÿ0,ÿnotestÿaccumulate

            .ÿtestÿ_b[r_lns5ose:_cons]ÿ=ÿ0,ÿÿaccumulate

            ÿ(ÿ1)ÿÿ[r_lns2ose]_consÿ=ÿ0
            ÿ(ÿ2)ÿÿ[r_lns3ose]_consÿ=ÿ0
            ÿ(ÿ3)ÿÿ[r_lns4ose]_consÿ=ÿ0
            ÿ(ÿ4)ÿÿ[r_lns5ose]_consÿ=ÿ0

            ÿÿÿÿÿÿÿÿÿÿÿchi2(ÿÿ4)ÿ=ÿÿÿ19.09
            ÿÿÿÿÿÿÿÿÿProbÿ>ÿchi2ÿ=ÿÿÿÿ0.0008

            .ÿ//ÿLR
            .ÿestimatesÿstoreÿFull

            .ÿquietlyÿmixedÿpriceÿi.rep78,ÿremlÿdfmethod(residual)ÿnolrtestÿnolog

            .ÿlrtestÿFull

            Likelihood-ratioÿtestÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿLRÿchi2(4)ÿÿ=ÿÿÿÿÿ14.34
            (Assumption:ÿ.ÿnestedÿinÿFull)ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿProbÿ>ÿchi2ÿ=ÿÿÿÿ0.0063

            Note:ÿTheÿreportedÿdegreesÿofÿfreedomÿassumesÿtheÿnullÿhypothesisÿisÿnotÿon
            ÿÿÿÿÿÿtheÿboundaryÿofÿtheÿparameterÿspace.ÿÿIfÿthisÿisÿnotÿtrue,ÿthenÿthe
            ÿÿÿÿÿÿreportedÿtestÿisÿconservative.
            Note:ÿLRÿtestsÿbasedÿonÿREMLÿareÿvalidÿonlyÿwhenÿtheÿfixed-effects
            ÿÿÿÿÿÿspecificationÿisÿidenticalÿforÿbothÿmodels.

            .ÿ
            .ÿ/*ÿGivenÿthatÿyou'veÿgotÿit,ÿnowÿyouÿcanÿaccommodateÿitÿ.ÿ.ÿ.
            >ÿÿÿÿ.ÿ.ÿ.ÿandÿwithÿsmall-sampleÿtestÿstatistics,ÿtoÿboot.ÿÿ*/
            .ÿquietlyÿestimatesÿrestoreÿFull

            .ÿcontrastÿrep78,ÿsmallÿÿÿ

            Contrastsÿofÿmarginalÿlinearÿpredictions

            Marginsÿÿÿÿÿÿ:ÿasbalanced

            -----------------------------------------------------------
            ÿÿÿÿÿÿÿÿÿÿÿÿÿ|ÿÿÿÿÿÿÿÿÿdfÿÿÿÿÿÿÿÿddfÿÿÿÿÿÿÿÿÿÿÿFÿÿÿÿÿÿÿÿP>F
            -------------+---------------------------------------------
            priceÿÿÿÿÿÿÿÿ|
            ÿÿÿÿÿÿÿrep78ÿ|ÿÿÿÿÿÿÿÿÿÿ4ÿÿÿÿÿÿ69.00ÿÿÿÿÿÿÿÿ0.98ÿÿÿÿÿ0.4255
            -----------------------------------------------------------

            .ÿ
            .ÿsetÿlinesizeÿ`line_size'

            .ÿ
            .ÿexit

            endÿofÿdo-file


            .


            There are some user-written commands that are available for this, too, I think. (As well as for other things bearing the moniker.) That's why I recommended searching from within Stata.
            Thank you so much
            I will try this if I faced issues I will ask you

            Comment


            • #7
              Alkebsee:
              I typed:
              Code:
              oneway price rep78, bonferroni
              .

              That said, I would follow Joseph's excellent advice.
              Last edited by Carlo Lazzaro; 12 Nov 2020, 01:35.
              Kind regards,
              Carlo
              (Stata 19.0)

              Comment


              • #8
                Originally posted by Carlo Lazzaro View Post
                Alkebsee:
                I typed:
                Code:
                oneway price rep78, bonferroni
                .

                That said, I would follow Joseph's excellent advice.
                thank you sooooo much

                Comment


                • #9
                  one more thing is
                  how to explain or interpret the result?

                  Comment

                  Working...
                  X