Stata帮助:针对替代假设的零假设

问题描述

您可以使用Stata如何针对替代假设检验原假设。如果我有针对H_0:\beta_1=\beta_2=0的假设H_A:\beta_1 ≠ \beta_2 ≠ 0。代码是什么?

解决方法

这可以使用testparmtest完成:

. sysuse auto,clear
    (1978 Automobile Data)

. replace weight = weight/1000
variable weight was int now float
(74 real changes made)

. reg price mpg weight i.foreign 

      Source |       SS           df       MS      Number of obs   =        74
-------------+----------------------------------   F(3,70)        =     23.29
       Model |   317252879         3   105750960   Prob > F        =    0.0000
    Residual |   317812517        70  4540178.81   R-squared       =    0.4996
-------------+----------------------------------   Adj R-squared   =    0.4781
       Total |   635065396        73  8699525.97   Root MSE        =    2130.8

------------------------------------------------------------------------------
       price |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
         mpg |   21.85361   74.22114     0.29   0.769    -126.1758     169.883
      weight |   3464.706    630.749     5.49   0.000     2206.717    4722.695
             |
     foreign |
    Foreign  |    3673.06   683.9783     5.37   0.000     2308.909    5037.212
       _cons |  -5853.696   3376.987    -1.73   0.087    -12588.88    881.4934
------------------------------------------------------------------------------

. test weight=1.foreign=3500

 ( 1)  weight - 1.foreign = 0
 ( 2)  weight = 3500

       F(  2,70) =    0.05
            Prob > F =    0.9466

双面p值存储在r(p)中:

. display r(p)
.94664298

相关问答

依赖报错 idea导入项目后依赖报错,解决方案:https://blog....
错误1:代码生成器依赖和mybatis依赖冲突 启动项目时报错如下...
错误1:gradle项目控制台输出为乱码 # 解决方案:https://bl...
错误还原:在查询的过程中,传入的workType为0时,该条件不起...
报错如下,gcc版本太低 ^ server.c:5346:31: 错误:‘struct...