Announcement

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

  • bootstrapping with inequal7

    Hello all,
    I have a long dataset and am trying to bootstrap differences between coefficient of variation (COV) in two years. I am using the command below and have tried several variations. Any help would be very much appreciated.

    bootstrap diff = (r(cov1) - r(cov2)), reps(50) seed(51617) strata(year): inequal7 adaF_, by(year) if year == 1994 | year == 2022

    Thanks,
    Arun

  • #2
    Inequal7 does not accept by, you need to write a program for this goal:

    Code:
    clear all
    version 16.1
    webuse nlswork
    keep if inlist(year, 68, 80)
    
    
    cap program drop inequaldiff
    program define inequaldiff, rclass
       inequal7 ln_wage if year == 68
       local res1 = r(cov)
       inequal7 ln_wage if year == 80
       local res2 = r(cov)
       return scalar diff = `res1' - `res2'
    end
    
    
    inequaldiff        //Test
    return list
    
    
    bootstrap result = r(diff), reps(50) seed(123) strata(year): inequaldiff
    estat bootstrap
    Best wishes

    Stata 18.0 MP | ORCID | Google Scholar

    Comment


    • #3
      Felix Bittmann: I was able to run the test—many thanks for your help.

      Comment

      Working...
      X