Announcement

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

  • How to create loop to determine p-value for each cross-section in xtcointtreg

    Hi! Everyone,
    I am trying to run DOLS and want to find out the effect for each cross-section. I want to compute p-value automatically for each cross-section. I am currently using the following command but it is giving for the entire model. not individual cross-section.

    *PVALUES MODEL1
    xtcointreg modprice1 perish_days stringency perish_STR, xtrend(1) est(dols) dic(aic) full

    foreach var in perish_days stringency perish_STR{
    gen p_`var'1= 2*(normal(-(_b[`var']/_se[`var'])))
    }
    est sto model1
    esttab model1 , s(p_perish_days p_perish_STR, fmt(%9.4f))

    Any suggestions regarding this would be helpful.

  • #2
    Hi Everyone!!!
    I am running the following command and using full option getting the t-stat for all my cross sections.

    xtcointreg modprice stringency, est(dols) full
    Method of estimation: dols
    Number

    Tab[31,1]
    stringency
    r1 .
    beta_1 1.88
    Se._1 6.24
    t-stat_1 0.30
    beta_2 0.16
    Se._2 3.59
    t-stat_2 0.05
    beta_3 -1.03
    Se._3 9.92
    t-stat_3 -0.10
    beta_4 -0.30
    Se._4 4.73
    t-stat_4 -0.06
    beta_5 -21.68
    Se._5 20.85
    t-stat_5 -1.04
    beta_6 3.84
    Se._6 4.46
    t-stat_6 0.86
    beta_7 -4.14
    Se._7 7.51
    t-stat_7 -0.55
    beta_8 40.82
    Se._8 12.62
    t-stat_8 3.24
    beta_9 4.04
    Se._9 6.54
    t-stat_9 0.62
    beta_10 9.87
    Se._10 2.03
    t-stat_10 4.86

    Cave[1,2]
    beta t-stat
    stringency 3.35 2.58

    I want to create a loop so that the p-value and significance are directly calculated but when I use the following command it is showing syntax error:
    forvalues i 1(1)10{
    gen p_`i'=2*(1-normal(abs(t-stat_`i')))
    di `i' p_`i'
    }
    Any suggestions regarding where I am going wrong in creating the loop would be helpful.
    Thanks for sparing your time!!

    Comment

    Working...
    X