Announcement

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

  • how to test residual in "rangestat (reg)"

    hello teacher and professor
    I have a question need help
    when I use "rangestat (reg)' to run each factor vector
    How do we test residual whether it exists a series correlation?
    "​​​​rangestat (reg) Rpret smb hml rmrf, interval(year 0 0) by(id)"

    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input double(b_smb b_hml b_rmrf b_cons se_smb se_hml se_cons)
    -.20652245619744625 5.588731457500937 -1.1446349668550027  -5.754353802046955 1.4416125962982962 1.4236890032042868  3.075380492257918
    -.20652245619744625 5.588731457500937 -1.1446349668550027  -5.754353802046955 1.4416125962982962 1.4236890032042868  3.075380492257918
    -.20652245619744625 5.588731457500937 -1.1446349668550027  -5.754353802046955 1.4416125962982962 1.4236890032042868  3.075380492257918
    -.20652245619744625 5.588731457500937 -1.1446349668550027  -5.754353802046955 1.4416125962982962 1.4236890032042868  3.075380492257918
    -.20652245619744625 5.588731457500937 -1.1446349668550027  -5.754353802046955 1.4416125962982962 1.4236890032042868  3.075380492257918
    -.20652245619744625 5.588731457500937 -1.1446349668550027  -5.754353802046955 1.4416125962982962 1.4236890032042868  3.075380492257918
    -.20652245619744625 5.588731457500937 -1.1446349668550027  -5.754353802046955 1.4416125962982962 1.4236890032042868  3.075380492257918
    -.20652245619744625 5.588731457500937 -1.1446349668550027  -5.754353802046955 1.4416125962982962 1.4236890032042868  3.075380492257918
    -.20652245619744625 5.588731457500937 -1.1446349668550027  -5.754353802046955 1.4416125962982962 1.4236890032042868  3.075380492257918
    -.20652245619744625 5.588731457500937 -1.1446349668550027  -5.754353802046955 1.4416125962982962 1.4236890032042868  3.075380492257918
    -.20652245619744625 5.588731457500937 -1.1446349668550027  -5.754353802046955 1.4416125962982962 1.4236890032042868  3.075380492257918
     1.7391401771765747 2.211614664163056  .23796205251361655 -1.7707955779777529 1.1680848697947528 1.1610380157758708 1.8474730466446276
     1.7391401771765747 2.211614664163056  .23796205251361655 -1.7707955779777529 1.1680848697947528 1.1610380157758708 1.8474730466446276
     1.7391401771765747 2.211614664163056  .23796205251361655 -1.7707955779777529 1.1680848697947528 1.1610380157758708 1.8474730466446276
     1.7391401771765747 2.211614664163056  .23796205251361655 -1.7707955779777529 1.1680848697947528 1.1610380157758708 1.8474730466446276
     1.7391401771765747 2.211614664163056  .23796205251361655 -1.7707955779777529 1.1680848697947528 1.1610380157758708 1.8474730466446276
     1.7391401771765747 2.211614664163056  .23796205251361655 -1.7707955779777529 1.1680848697947528 1.1610380157758708 1.8474730466446276
     1.7391401771765747 2.211614664163056  .23796205251361655 -1.7707955779777529 1.1680848697947528 1.1610380157758708 1.8474730466446276
     1.7391401771765747 2.211614664163056  .23796205251361655 -1.7707955779777529 1.1680848697947528 1.1610380157758708 1.8474730466446276
     1.7391401771765747 2.211614664163056  .23796205251361655 -1.7707955779777529 1.1680848697947528 1.1610380157758708 1.8474730466446276
    end

  • #2
    I am sorry, above code doesn't "collapse"
    after "collapse"

    How do we test residual whether it exists a series correlation?

    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input double(b_smb b_hml b_rmrf b_cons se_smb se_hml se_cons)
    -.20652245619744616   5.588731457500935 -1.1446349668550029  -5.754353802046956  1.441612596298296 1.4236890032042864 3.0753804922579175
     1.7391401771765747  2.2116146641630565  .23796205251361655  -1.770795577977753 1.1680848697947526 1.1610380157758708  1.847473046644627
     -.7810886719838043   -1.88907028729905  .37428289801551307 -1.8518828957499085 1.0104413554508134  1.505944754555825 2.2320656284728737
     21.889444017876958  -3.023512820017274   5.810818276929202  34.928552359967284  50.20737891474858 31.333495893292827  68.67890356510735
    -2.8797244862097275  -5.026163582241934  -2.008551149487911  -2.597368325814537  2.700217324382705 3.3214409344940994  6.783314698271318
     .13143394323090157  -1.536547529409116   4.151728317053759 -3.8736562665458365 2.0138699829330915 1.5924683915309743  2.992455564621307
     3.2410548015003378   -3.49072956631237  1.9434866335383216   6.592450031991846  2.387408400632889  3.089041482383419  6.645989954843443
     -.5959161530517129 -1.0470932552648224   2.139012416944461   -3.34773633595546   2.55670001679453 2.5412758877313837  4.043742446739961
      2.459073528867397  2.3425396664387264  2.2264114516441533 -1.8611356640818142  1.195624012391026 1.7819378632596983 2.6411342412288508
    -1.3246451896776745 -3.2911161430741243   .5846952840197578  3.4057650172635414  4.069514188553036  2.539708482516827  5.566707096720578
     -13.88725617885778 -12.464178657668725  -.9540348453651116  -3.957032077980094 13.426050217249776  9.267028548300916 12.334600256033822
      .5222894906819473  .41727537410336174  1.7836132287388071  -.2535254473333555  2.125050614015634 1.9360592091404325   3.26274633723505
     2.5908444050180646 -.17021750304725938  1.4857151969760516   5.258425110823077 1.6481621320694335 1.4659714196267364  3.977462997616916
     .46000830066827353 -3.2269820287839646   3.008201275963082  -4.631410529332043  2.188100506192419 1.7302412385775734  3.251348692416428
      -1.97236093161582  1.2838017209405235   1.480261458009452  .14110582537912153 1.2464379870205737 1.6127524080523232 3.4697935798826953
     2.2495850003806583 -1.3700419329076092   1.982390800166147  -3.758231322691889  1.851950711210019  1.840778212832949 2.9290928349033805
      .8203493571638939  -4.623980889106769  2.2642189727267055  -6.089744650720889 1.5325395119708267  2.284071041581945  3.385380804629181
      -3.00919509336203   -3.60439886922451   .6618124576249785  1.8754543978984604   4.93916744347566 3.0824429825188226  6.756309767103509
                      .                   .                   .                   .                  .                  .                  .
     1.8254708294178785  -.4299303325564718  1.3129510800541053   .6557365933326728 1.2522706161064703 1.2447158840385961 1.9806233863540104
    end

    Comment


    • #3
      rangestat (SSC) does not purport to encapsulate all possible regression capability.

      Residuals are your own responsibility and can be calculated by subtracting the predicted response from the observed response.

      Comment


      • #4
        thanks, teacher
        If I calculate the residuals vector, which test can use?
        and how to write code?

        Comment

        Working...
        X