Welcome to Minitab, press F1 for help. MTB > #redo 5/18 ex z corr .85 MTB > random 10000 c1; SUBC> normal 10 2. MTB > descr c1 Descriptive Statistics: C1 Variable N N* Mean StDev Minimum Q1 Median Q3 Maximum C1 10000 0 9.9997 2.0194 1.9813 8.6532 9.9862 11.3454 19.2288 MTB > #create latentY MTB > random 10000 c2; SUBC> normal 0 1.24. MTB > name c2 'u' MTB > let c3 = c1 + c2 MTB > corr c1 c3 Pearson correlation of C1 and C3 = 0.853 MTB > name c3 'latentY' c1 'X' MTB > #create incomplete covariate Z (pure error) MTB > random 10000 c6; SUBC> normal 0 1.3. MTB > name c6 'v' MTB > let c7 = c1 + c6 MTB > name c7 'Z' MTB > desc z Descriptive Statistics: Z Variable N N* Mean StDev Minimum Q1 Median Q3 Maximum Z 10000 0 9.9922 2.3881 1.0482 8.4139 10.0048 11.5400 19.3687 MTB > corr c1 c7 Pearson correlation of X and Z = 0.840 MTB > random 10000 c6; SUBC> normal 0 1.1. MTB > name c6 'v' MTB > let c7 = c1 + c6 MTB > name c7 'Z' MTB > desc z Descriptive Statistics: Z Variable N N* Mean StDev Minimum Q1 Median Q3 Maximum Z 10000 0 10.013 2.294 0.168 8.496 10.000 11.560 18.880 MTB > corr c1 c7 Pearson correlation of X and Z = 0.878 MTB > # probabilstic assignment on X MTB > let c8 = 1 - (1/(1 + 1/exp(-5 + .5*c1)) ) MTB > corr c8 c1 Pearson correlation of C8 and X = -0.991 MTB > name c8 'truepropen' MTB > %D:\drr04\ed260\propen.mtb Executing from file: D:\drr04\ed260\propen.mtb MTB > name c11 'G' MTB > desc c1; SUBC> by c11. Descriptive Statistics: X Variable G N N* Mean StDev Minimum Q1 Median Q3 Maximum X 0 4937 0 10.848 1.829 3.637 9.578 10.811 12.074 19.229 1 5063 0 9.1726 1.8455 1.9813 7.9610 9.2083 10.3970 15.2768 MTB > %percentile c1 c4 c9-c10; SUBC> by c11. Executing from file: C:\Program Files\MINITAB 14\MACROS\percentile.MAC Percentiles Column: X Group: 0 Group: 1 The 20.00th percentile is 9.28547. The 20.00th percentile is 7.65569. The 40.00th percentile is 10.35087. The 40.00th percentile is 8.71809. The 60.00th percentile is 11.29604. The 60.00th percentile is 9.67128. The 80.00th percentile is 12.38806. The 80.00th percentile is 10.66787. MTB > let c12 = c3 + 1.2*c11 MTB > name c12 'obsY' MTB > desc c12; SUBC> by c11. Descriptive Statistics: obsY Variable G N N* Mean StDev Minimum Q1 Median Q3 Maximum obsY 0 4937 0 10.830 2.187 3.350 9.293 10.800 12.300 20.266 1 5063 0 10.349 2.232 2.365 8.844 10.386 11.826 19.395 MTB > brief 1 MTB > regress c12 1 c11 Regression Analysis: obsY versus G The regression equation is obsY = 10.8 - 0.482 G Predictor Coef SE Coef T P Constant 10.8303 0.0315 344.36 0.000 G -0.48182 0.04420 -10.90 0.000 S = 2.20983 R-Sq = 1.2% R-Sq(adj) = 1.2% MTB > regress c12 2 c11 c1 Regression Analysis: obsY versus G, X The regression equation is obsY = 0.0063 + 1.19 G + 0.998 X Predictor Coef SE Coef T P Constant 0.00631 0.07491 0.08 0.933 G 1.18983 0.02712 43.88 0.000 X 0.997794 0.006714 148.62 0.000 S = 1.23355 R-Sq = 69.2% R-Sq(adj) = 69.2% MTB > regress c12 2 c11 c7 Regression Analysis: obsY versus G, Z The regression equation is obsY = 2.85 + 0.752 G + 0.735 Z Predictor Coef SE Coef T P Constant 2.85042 0.08229 34.64 0.000 G 0.75223 0.03347 22.47 0.000 Z 0.734546 0.007295 100.69 0.000 S = 1.55714 R-Sq = 50.9% R-Sq(adj) = 50.9% MTB > %percentile c7 c4 c9-c10; SUBC> by c11. Executing from file: C:\Program Files\MINITAB 14\MACROS\percentile.MAC Percentiles Column: Z Group: 0 Group: 1 The 20.00th percentile is 9.06941. The 20.00th percentile is 7.39138 The 40.00th percentile is 10.28276. The 40.00th percentile is 8.70336 The 60.00th percentile is 11.39312. The 60.00th percentile is 9.73112 The 80.00th percentile is 12.67470. The 80.00th percentile is 10.96560 MTB > blog c11 = c1; SUBC> eprobability c9. Binary Logistic Regression: G versus X Link Function: Logit Logistic Regression Table Odds 95% CI Predictor Coef SE Coef Z P Ratio Lower Upper Constant 5.03194 0.133482 37.70 0.000 X -0.500149 0.0131430 -38.05 0.000 0.61 0.59 0.62 MTB > name c9 'propensityX' MTB > blog c11 = c7; SUBC> eprobability c10. Binary Logistic Regression: G versus Z Logistic Regression Table Odds 95% CI Predictor Coef SE Coef Z P Ratio Lower Upper Constant 3.72878 0.110221 33.83 0.000 Z -0.369537 0.0107801 -34.28 0.000 0.69 0.68 0.71 MTB > name c10 'propensityZ' MTB > %percentile c9 c4 c5 Executing from file: C:\Program Files\MINITAB 14\MACROS\percentile.MAC Percentiles Column: propensityX The 20.00th percentile is 0.30589. The 40.00th percentile is 0.44657. The 60.00th percentile is 0.57177. The 80.00th percentile is 0.70403. MTB > %percentile c10 c4 c5 Executing from file: C:\Program Files\MINITAB 14\MACROS\percentile.MAC Percentiles Column: propensityZ The 20.00th percentile is 0.33443. The 40.00th percentile is 0.45341. The 60.00th percentile is 0.56299. The 80.00th percentile is 0.67620. MTB > name c13 'propcatX' MTB > Code (0 : .30589) 1 (.30589001: .44657) 2 (.4465701 : .57177) 3 (.57177001: & CONT> .70403) 4 (.70403001:1.00) 5 c9 c13 MTB > tally c13 Tally for Discrete Variables: propcatX propcatX Count 1 2000 2 1999 3 2001 4 2001 5 1999 N= 10000 MTB > table c13 c11 Tabulated statistics: propcatX, G Rows: propcatX Columns: G 0 1 All 1 1587 413 2000 2 1223 776 1999 3 978 1023 2001 4 748 1253 2001 5 401 1598 1999 All 4937 5063 10000 Cell Contents: Count MTB > table c13 c11; SUBC> mean c12. Tabulated statistics: propcatX, G Rows: propcatX Columns: G 0 1 All 1 12.88 13.76 13.06 2 11.04 12.20 11.49 3 9.97 11.15 10.57 4 9.03 10.08 9.69 5 7.55 8.26 8.12 All 10.83 10.35 10.59 Cell Contents: obsY : Mean MTB > name c14 'propcatZ' MTB > Code (0 : .33443) 1 (.33443001: .45341) 2 (.4534101 : .56299) 3 (.5629901: & CONT> .67620) 4 (.6762001:1.00) 5 c10 c14 MTB > tally c14 Tally for Discrete Variables: propcatZ propcatZ Count 1 2000 2 2000 3 2000 4 2000 5 2000 N= 10000 MTB > table c14 c11 Tabulated statistics: propcatZ, G Rows: propcatZ Columns: G 0 1 All 1 1526 474 2000 2 1189 811 2000 3 970 1030 2000 4 771 1229 2000 5 481 1519 2000 All 4937 5063 10000 Cell Contents: Count MTB > table c14 c11; SUBC> mean c12. Tabulated statistics: propcatZ, G Rows: propcatZ Columns: G 0 1 All 1 12.62 13.13 12.74 2 11.10 11.82 11.39 3 10.19 10.93 10.57 4 9.32 10.08 9.79 5 8.18 8.52 8.44 All 10.83 10.35 10.59 Cell Contents: obsY : Mean MTB > # put propcat/G Y-means in cols, X c15-16 Z c17-18 MTB > let c19 = c16 - c15 MTB > let c20 = c18- c17 MTB > mean c19 Mean of C19 = 0.996 MTB > meAN C20 Mean of C20 = 0.614 MTB > print c15-c20 Row C15 C16 C17 C18 C19 C20 1 12.88 13.76 12.62 13.13 0.88 0.51 2 11.04 12.20 11.10 11.82 1.16 0.72 3 9.97 11.15 10.19 10.93 1.18 0.74 4 9.03 10.08 9.32 10.08 1.05 0.76 5 7.55 8.26 8.18 8.52 0.71 0.34