Announcement

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

  • CEM: Stata vs R

    Dear StataListers,

    I can't get why the analyzes below, performed in Stata / R, do not produce the same result.

    Please provide your suggestions for the explanation for these differences.

    Thanks,
    Martine

    PS (how) can I display the actual cutpoints in Stata (imb)?


    -- STATA
    . import delimited "G:\Recidive\Projecten\Verkeer\Algemeen\Artike l effectiviteit ASP tijdens\Data\Data voor R.csv", clear
    (8 vars, 8,627 obs)

    . imb d_sekse lftbegrec d_addinfo_ind_best lftinsz1 vgalgexuz vgverkexuz vgrijoiuz, treatment (treat)
    (using the scott break method for L1 distance)

    Multivariate L1 distance: .68243298

    Univariate imbalance:

    L1 mean min 25% 50% 75% max
    d_sekse .01557 -.01557 0 0 0 0 0
    lftbegrec .0687 -1.5626 0 -1 -2 -1 -5
    d_addinfo_ind_best .00497 -.00497 0 0 0 0 0
    lftinsz1 .08852 .91045 0 1 1 2 -12
    vgalgexuz .14912 -1.2611 0 0 -1 -1 78
    vgverkexuz .09852 -.41727 0 0 0 -1 4
    vgrijoiuz .11859 -.36406 0 0 0 0 -4



    --R
    > data <- read.csv(file = "G:\\Recidive\\Projecten\\Verkeer\\Algemeen\\A rtik el effectiviteit ASP tijdens\\Data\\Data voor R.csv")
    > cov <- c("D_SEKSE", "LFTBEGREC", "D_ADDINFO_IND_BEST","LFTINSZ1", "VGALGEXUZ", "VGVERKEXUZ", "VGRIJOIUZ")
    > imb <- imbalance(group = data$TREAT, data = data[cov])
    > imb

    Multivariate Imbalance Measure: L1=0.665
    Percentage of local common support: LCS=11.2%

    Univariate Imbalance Measures:

    statistic type L1 min 25% 50% 75% max
    D_SEKSE -0.015571508 (diff) 0.015571508 0 0 0 0 0
    LFTBEGREC -1.562561051 (diff) 0.025019213 0 -1 -2 -1 -5
    D_ADDINFO_IND_BEST -0.004970458 (diff) 0.004970458 0 0 0 0 0
    LFTINSZ1 0.910454843 (diff) 0.045867098 0 1 1 2 -12
    VGALGEXUZ -1.261056065 (diff) 0.146272471 0 0 -1 -1 78
    VGVERKEXUZ -0.417271627 (diff) 0.097957912 0 0 0 -1 4
    VGRIJOIUZ -0.364063976 (diff) 0.118028583 0 0 0 0 -4
    Last edited by Martine Blom; 21 Feb 2020, 06:15.

  • #2
    Aren't they equal? cem in Stata report L1 and then the mean difference. cem in R reports the difference and then L1 statistics.

    In Stata the -cem- option -showbreaks- displays the cutpoints used for each variable

    Comment

    Working...
    X