BookmarkSubscribeRSS Feed
jhmoon
Obsidian | Level 7

Dear all,

 

I posted same title 2 weeks ago, and I do it again after making it clear to see.

previous post: https://communities.sas.com/t5/Statistical-Procedures/Different-results-between-glm-and-glmselect/td...

 

My problem is that when I did a  event study analysis with code 'glm' and 'glmselect', the results are not the same, and I want to know why.

Specifically, I use event-study method, and the outcome variable is "calc_cpi", RHS variables are 9 event time dummies, 18 year dummies and 18 age dummies. 

Weight variable here is constructed by this way: the number of cohort 2 / the number of cohort 1 (by age at event occurs).

So, cohort 2 has 1 for the weight for all samples. Cohort 1 has the weight by age at event time zero.

 

Case 1: all the results are right both by glm and glmselect without weights applied.

 

Case 2: 'glmselect' has a problem. Here's the code and output. (first one is glm result, and second one is glmselect result)

 

PROC GLM DATA=IPW.TREAT_BASE_SAMPLE_CHT70  ;
CLASS EVENT_TIME(REF='-1') AGE(REF='39') STD_YYYY(REF='2019');
MODEL CALC_CPI = EVENT_TIME AGE STD_YYYY/ SOLUTION;
WEIGHT C1_WEIGHT;
OUTPUT OUT= PRED_CALC_CPI_WC1 PREDICTED=P RESIDUAL=R;
ODS OUTPUT ParameterEstimates=PARAM_CALC_CPI_WC1;
RUN;


PROC GLMSELECT DATA=IPW.TREAT_BASE_SAMPLE_CHT70 ;
CLASS EVENT_TIME(REF='-1') AGE STD_YYYY ;
MODEL CALC_CPI = EVENT_TIME AGE STD_YYYY/ SELECTION=NONE ;
WEIGHT C1_WEIGHT;
OUTPUT OUT= PRED_CALC_CPI_WC1 PREDICTED=P RESIDUAL=R;
ODS OUTPUT ParameterEstimates=PARAM_CALC_CPI_WC1;
RUN;
DependentParameterEstimateBiasedStdErrtValueProbt
CALC_CPIIntercept57493.580841598.536091396.06<.0001
CALC_CPIEVENT_TIME -31151.43048167.74640917<.0001
CALC_CPIEVENT_TIME -21290.48506163.740961620.25<.0001
CALC_CPIEVENT_TIME 0-6709.90206163.2582534-106.07<.0001
CALC_CPIEVENT_TIME 1-16152.14249165.8422001-245.32<.0001
CALC_CPIEVENT_TIME 2-18193.03078167.8515907-268.13<.0001
CALC_CPIEVENT_TIME 3-19273.77713170.6162547-272.94<.0001
CALC_CPIEVENT_TIME 4-20520.90805173.7837183-278.12<.0001
CALC_CPIEVENT_TIME 5-21161.09299177.6282235-272.6<.0001
CALC_CPIEVENT_TIME -101   
CALC_CPIAGE        22-33011.332261453.9691843-72.72<.0001
CALC_CPIAGE        23-31030.138561417.0497166-74.4<.0001
CALC_CPIAGE        24-28456.203841404.3707065-70.37<.0001
CALC_CPIAGE        25-26188.467211398.0201918-65.8<.0001
CALC_CPIAGE        26-24184.50521394.2489703-61.34<.0001
CALC_CPIAGE        27-22544.715821391.5407826-57.58<.0001
CALC_CPIAGE        28-20991.748131389.4779456-53.9<.0001
CALC_CPIAGE        29-19253.743071387.720454-49.66<.0001
CALC_CPIAGE        30-17464.851051386.0938409-45.23<.0001
CALC_CPIAGE        31-15496.642411384.8382356-40.27<.0001
CALC_CPIAGE        32-13496.683911383.4668709-35.2<.0001
CALC_CPIAGE        33-11624.098231381.9453759-30.43<.0001
CALC_CPIAGE        34-9663.065631380.3173421-25.41<.0001
CALC_CPIAGE        35-7642.137931377.3506788-20.25<.0001
CALC_CPIAGE        36-5740.09341374.7912852-15.32<.0001
CALC_CPIAGE        37-3900.210781373.8001484-10.43<.0001
CALC_CPIAGE        38-1949.436891377.7374853-5.16<.0001
CALC_CPIAGE        3901   
CALC_CPISTD_YYYY   2002-16249.472421723.7739723-22.45<.0001
CALC_CPISTD_YYYY   2003-13821.109081715.5893296-19.31<.0001
CALC_CPISTD_YYYY   2004-11888.85231712.2320853-16.69<.0001
CALC_CPISTD_YYYY   2005-11398.1111710.29501-16.05<.0001
CALC_CPISTD_YYYY   2006-9609.676121708.9337932-13.56<.0001
CALC_CPISTD_YYYY   2007-7473.766681707.8289777-10.56<.0001
CALC_CPISTD_YYYY   2008-5956.854241706.8830577-8.43<.0001
CALC_CPISTD_YYYY   2009-5790.10941706.0041004-8.2<.0001
CALC_CPISTD_YYYY   2010-5811.822231705.1423241-8.24<.0001
CALC_CPISTD_YYYY   2011-5341.591431704.5219159-7.58<.0001
CALC_CPISTD_YYYY   2012-4584.695261703.8424319-6.51<.0001
CALC_CPISTD_YYYY   2013-4165.11981703.2508081-5.92<.0001
CALC_CPISTD_YYYY   2014-3306.63571702.6738477-4.71<.0001
CALC_CPISTD_YYYY   2015-2796.687221700.2987691-3.99<.0001
CALC_CPISTD_YYYY   2016-2641.52681700.5926244-3.770.0002
CALC_CPISTD_YYYY   2017-2145.887241704.8095795-3.040.0023
CALC_CPISTD_YYYY   2018-1733.120061722.7610169-2.40.0165
CALC_CPISTD_YYYY   201901   

 

EffectEVENT_TIMEAGESTD_YYYYParameterDFEstimateStandardizedEstStdErrtValueProbt
Intercept   Intercept15616.72173505861231.5630.000.9992
EVENT_TIME-3  EVENT_TIME -311151.4304820.01021440767.7464149217.000.0000
EVENT_TIME-2  EVENT_TIME -211290.4850720.01144565263.7409671420.250.0000
EVENT_TIME0  EVENT_TIME 01-6709.902053-0.05940182763.25825897-106.070.0000
EVENT_TIME1  EVENT_TIME 11-16152.14248-0.13952556165.84220583-245.320.0000
EVENT_TIME2  EVENT_TIME 21-18193.03077-0.15926217667.85159667-268.130.0000
EVENT_TIME3  EVENT_TIME 31-19273.77712-0.1687872570.61626087-272.940.0000
EVENT_TIME4  EVENT_TIME 41-20520.90803-0.17932204373.78372473-278.120.0000
EVENT_TIME5  EVENT_TIME 51-21161.09296-0.18516769977.62823033-272.600.0000
EVENT_TIME-1  EVENT_TIME -1000   
AGE 22 AGE        221-33011.33219-0.072258126453.9692229-72.720.0000
AGE 23 AGE        231-31030.13848-0.105624115417.0497519-74.400.0000
AGE 24 AGE        241-28456.20376-0.129083905404.3707406-70.370.0000
AGE 25 AGE        251-26188.46713-0.148142386398.0202253-65.800.0000
AGE 26 AGE        261-24184.50513-0.16058298394.2490035-61.340.0000
AGE 27 AGE        271-22544.71575-0.169706244391.5408156-57.580.0000
AGE 28 AGE        281-20991.74806-0.171072624389.4779784-53.900.0000
AGE 29 AGE        291-19253.743-0.164343939387.7204866-49.660.0000
AGE 30 AGE        301-17464.85098-0.152418958386.0938734-45.230.0000
AGE 31 AGE        311-15496.64234-0.132617654384.8382679-40.270.0000
AGE 32 AGE        321-13496.68384-0.11066162383.4669031-35.200.0000
AGE 33 AGE        331-11624.09816-0.089483332381.9454081-30.430.0000
AGE 34 AGE        341-9663.065559-0.067725564380.3173741-25.410.0000
AGE 35 AGE        351-7642.137868-0.046998557377.3507106-20.250.0000
AGE 36 AGE        361-5740.093333-0.028803712374.7913168-15.320.0000
AGE 37 AGE        371-3900.210716-0.01479889373.8001801-10.430.0000
AGE 38 AGE        381-1949.436833-0.005011604377.7375174-5.160.0000
AGE 39 AGE        39000   
STD_YYYY  2002STD_YYYY   2002135627.38660.1429643685861231.5730.010.9952
STD_YYYY  2003STD_YYYY   2003138055.749940.2074658755861231.5720.010.9948
STD_YYYY  2004STD_YYYY   2004139988.006730.2626888215861231.5710.010.9946
STD_YYYY  2005STD_YYYY   2005140478.748030.2974240035861231.5710.010.9945
STD_YYYY  2006STD_YYYY   2006142267.18290.3339665315861231.5710.010.9942
STD_YYYY  2007STD_YYYY   2007144403.092340.3695948655861231.5710.010.9940
STD_YYYY  2008STD_YYYY   2008145920.004780.3937615085861231.5710.010.9937
STD_YYYY  2009STD_YYYY   2009146086.749620.4015526325861231.5710.010.9937
STD_YYYY  2010STD_YYYY   2010146065.036780.4020401265861231.5710.010.9937
STD_YYYY  2011STD_YYYY   2011146535.267580.3700954635861231.5710.010.9937
STD_YYYY  2012STD_YYYY   2012147292.163760.3380984455861231.5710.010.9936
STD_YYYY  2013STD_YYYY   2013147711.739220.2960784035861231.5710.010.9935
STD_YYYY  2014STD_YYYY   2014148570.223320.2566418295861231.5710.010.9934
STD_YYYY  2015STD_YYYY   2015149080.17180.2128325555861231.5710.010.9933
STD_YYYY  2016STD_YYYY   2016149235.332230.1629055385861231.5710.010.9933
STD_YYYY  2017STD_YYYY   2017149730.971790.1167195285861231.5720.010.9932
STD_YYYY  2018STD_YYYY   2018150143.738980.0718743295861231.5750.010.9932
STD_YYYY  2019STD_YYYY   2019151876.857680.0358897685861231.5930.010.9929

 

With glmselect code, STD_YYYY has no reference dummy which should be omitted.

 

Case 3: When I do a subgroup analysis with 'by' option, there's a different problem here.

'Metro' variable is a dummy for indicating the metro city.

 

PROC GLM DATA=IPW.TREAT_BASE_SAMPLE_CHT70  ;
CLASS EVENT_TIME(REF='-1') AGE(REF='39') STD_YYYY(REF='2019');
MODEL CALC_CPI = EVENT_TIME AGE STD_YYYY/ SOLUTION;
BY METRO;
WEIGHT C1_WEIGHT;
OUTPUT OUT= PRED_CALC_CPI_WC1 PREDICTED=P RESIDUAL=R;
ODS OUTPUT ParameterEstimates=PARAM_CALC_CPI_WC1;
RUN;

PROC GLMSELECT DATA=IPW.TREAT_BASE_SAMPLE_CHT70 ;
CLASS EVENT_TIME(REF='-1') AGE STD_YYYY ;
MODEL CALC_CPI = EVENT_TIME AGE STD_YYYY/ SELECTION=NONE ;
BY METRO;
WEIGHT C1_WEIGHT;
OUTPUT OUT= PRED_CALC_CPI_WC1 PREDICTED=P RESIDUAL=R;
ODS OUTPUT ParameterEstimates=PARAM_CALC_CPI_WC1;
RUN;
METRODependentParameterEstimateBiasedStdErrtValueProbt
0CALC_CPIIntercept-3895.1227817729975.6540.000.9996
0CALC_CPIEVENT_TIME -3978.61218187.7950176811.150.0000
0CALC_CPIEVENT_TIME -21180.69630182.2755189914.350.0000
0CALC_CPIEVENT_TIME 0-6342.50198181.54173762-77.780.0000
0CALC_CPIEVENT_TIME 1-14450.89523184.74718996-170.520.0000
0CALC_CPIEVENT_TIME 2-16030.37882187.51248946-183.180.0000
0CALC_CPIEVENT_TIME 3-16749.01300191.07836901-183.900.0000
0CALC_CPIEVENT_TIME 4-17470.41779195.08922474-183.730.0000
0CALC_CPIEVENT_TIME 5-17515.59945199.91195499-175.310.0000
0CALC_CPIEVENT_TIME -10.000001   
0CALC_CPIAGE        223726.46625016834818.10.000.9998
0CALC_CPIAGE        235682.55616016834818.10.000.9997
0CALC_CPIAGE        248018.60850016834818.10.000.9996
0CALC_CPIAGE        259747.53333016834818.10.000.9995
0CALC_CPIAGE        2611121.30219016834818.10.000.9995
0CALC_CPIAGE        2712108.09981016834818.10.000.9994
0CALC_CPIAGE        2813026.26507016834818.10.000.9994
0CALC_CPIAGE        2914138.23528016834818.10.000.9993
0CALC_CPIAGE        3015416.94606016834818.10.000.9993
0CALC_CPIAGE        3116866.27534016834818.10.000.9992
0CALC_CPIAGE        3218346.09867016834818.10.000.9991
0CALC_CPIAGE        3319629.98543016834818.10.000.9991
0CALC_CPIAGE        3420940.93670016834818.10.000.9990
0CALC_CPIAGE        3522268.69419016834818.10.000.9989
0CALC_CPIAGE        3623498.42169016834818.10.000.9989
0CALC_CPIAGE        3724639.75805016834818.10.000.9988
0CALC_CPIAGE        3826288.30791016834818.10.000.9988
0CALC_CPIAGE        3927677.95218016834818.110.000.9987
0CALC_CPISTD_YYYY   20028299.40414016722040.850.000.9996
0CALC_CPISTD_YYYY   200310663.93296016722040.850.000.9995
0CALC_CPISTD_YYYY   200412542.76508016722040.850.000.9994
0CALC_CPISTD_YYYY   200513203.85921016722040.850.000.9994
0CALC_CPISTD_YYYY   200614851.59210016722040.850.000.9993
0CALC_CPISTD_YYYY   200716799.61320016722040.850.000.9992
0CALC_CPISTD_YYYY   200818178.73109016722040.850.000.9991
0CALC_CPISTD_YYYY   200918532.44842016722040.850.000.9991
0CALC_CPISTD_YYYY   201018300.38044016722040.850.000.9991
0CALC_CPISTD_YYYY   201118846.57380016722040.850.000.9991
0CALC_CPISTD_YYYY   201219583.46699016722040.850.000.9991
0CALC_CPISTD_YYYY   201320241.00004016722040.850.000.9990
0CALC_CPISTD_YYYY   201421323.54965016722040.850.000.9990
0CALC_CPISTD_YYYY   201521817.24317016722040.850.000.9990
0CALC_CPISTD_YYYY   201622159.80750016722040.850.000.9989
0CALC_CPISTD_YYYY   201722649.12430016722040.860.000.9989
0CALC_CPISTD_YYYY   201823302.41868016722040.860.000.9989
0CALC_CPISTD_YYYY   201924949.93483016722040.880.000.9988
1CALC_CPIIntercept42176.4337918924444.1660.000.9962
1CALC_CPIEVENT_TIME -3994.341861101.14869699.830.0000
1CALC_CPIEVENT_TIME -21215.89427195.4516294112.740.0000
1CALC_CPIEVENT_TIME 0-6843.48301194.85321721-72.150.0000
1CALC_CPIEVENT_TIME 1-17267.81526198.94975143-174.510.0000
1CALC_CPIEVENT_TIME 2-19545.151221101.8492618-191.900.0000
1CALC_CPIEVENT_TIME 3-20748.459191106.0721071-195.610.0000
1CALC_CPIEVENT_TIME 4-22258.636161110.9774742-200.570.0000
1CALC_CPIEVENT_TIME 5-23210.702181116.9501239-198.470.0000
1CALC_CPIEVENT_TIME -10.000001   
1CALC_CPIAGE        22-16614.4768918924444.2270.000.9985
1CALC_CPIAGE        23-14644.8790418924444.2220.000.9987
1CALC_CPIAGE        24-11836.9112818924444.2210.000.9989
1CALC_CPIAGE        25-9061.9250518924444.220.000.9992
1CALC_CPIAGE        26-6561.3208018924444.220.000.9994
1CALC_CPIAGE        27-4455.0309018924444.2190.000.9996
1CALC_CPIAGE        28-2508.5036918924444.2190.000.9998
1CALC_CPIAGE        29-433.2474818924444.2190.001.0000
1CALC_CPIAGE        301583.4657518924444.2190.000.9999
1CALC_CPIAGE        313797.7935918924444.2190.000.9997
1CALC_CPIAGE        326034.5203318924444.2190.000.9995
1CALC_CPIAGE        338181.4285018924444.2190.000.9993
1CALC_CPIAGE        3410412.4936018924444.2190.000.9991
1CALC_CPIAGE        3512734.4546618924444.2180.000.9989
1CALC_CPIAGE        3614889.3907318924444.2180.000.9987
1CALC_CPIAGE        3717002.8123218924444.2180.000.9985
1CALC_CPIAGE        3818969.4121718924444.2190.000.9983
1CALC_CPIAGE        3921104.0215618924444.2040.000.9981
1CALC_CPISTD_YYYY   2002-16791.1776411029.07981-16.320.0000
1CALC_CPISTD_YYYY   2003-14332.5077311015.028264-14.120.0000
1CALC_CPISTD_YYYY   2004-12365.5300611009.390721-12.250.0000
1CALC_CPISTD_YYYY   2005-12066.3454111006.206658-11.990.0000
1CALC_CPISTD_YYYY   2006-10180.4721511004.022003-10.140.0000
1CALC_CPISTD_YYYY   2007-7857.9019911002.274509-7.840.0000
1CALC_CPISTD_YYYY   2008-6173.6529911000.796782-6.170.0000
1CALC_CPISTD_YYYY   2009-6142.298461999.4356916-6.150.0000
1CALC_CPISTD_YYYY   2010-5945.250201998.1000149-5.960.0000
1CALC_CPISTD_YYYY   2011-5474.526961997.101357-5.490.0000
1CALC_CPISTD_YYYY   2012-4632.715791996.0329327-4.650.0000
1CALC_CPISTD_YYYY   2013-4340.177201995.1040046-4.360.0000
1CALC_CPISTD_YYYY   2014-3545.840231994.2626587-3.570.0004
1CALC_CPISTD_YYYY   2015-2930.668371990.6913263-2.960.0031
1CALC_CPISTD_YYYY   2016-2804.046331991.2891071-2.830.0047
1CALC_CPISTD_YYYY   2017-2246.379081997.3882092-2.250.0243
1CALC_CPISTD_YYYY   2018-1946.5382511022.994013-1.900.0571
1CALC_CPISTD_YYYY   20190.000001   

 

METROEffectEVENT_TIMEAGESTD_YYYYParameterDFEstimateStandardizedEstStdErrtValueProbt
0Intercept   Intercept148732.764490823.280640959.190.0000
0EVENT_TIME-3  EVENT_TIME -31978.61218210.00987900387.7949849511.150.0000
0EVENT_TIME-2  EVENT_TIME -211180.6963010.01191674582.2754883214.350.0000
0EVENT_TIME0  EVENT_TIME 01-6342.501979-0.06393875281.54170722-77.780.0000
0EVENT_TIME1  EVENT_TIME 11-14450.89523-0.14288304184.74715836-170.520.0000
0EVENT_TIME2  EVENT_TIME 21-16030.37882-0.16006953687.51245683-183.180.0000
0EVENT_TIME3  EVENT_TIME 31-16749.013-0.16710919691.07833505-183.900.0000
0EVENT_TIME4  EVENT_TIME 41-17470.41779-0.1739533295.08918929-183.730.0000
0EVENT_TIME5  EVENT_TIME 51-17515.59946-0.17460470699.91191774-175.310.0000
0EVENT_TIME-1  EVENT_TIME -1000   
0AGE 22 AGE        221-23951.48593-0.065256495609.8976565-39.270.0000
0AGE 23 AGE        231-21995.39602-0.092291837571.3578958-38.500.0000
0AGE 24 AGE        241-19659.34367-0.10864938558.0981989-35.230.0000
0AGE 25 AGE        251-17930.41885-0.121767376551.3697335-32.520.0000
0AGE 26 AGE        261-16556.64999-0.129777789547.285133-30.250.0000
0AGE 27 AGE        271-15569.85237-0.136392915544.2738391-28.610.0000
0AGE 28 AGE        281-14651.6871-0.137586654541.9167938-27.040.0000
0AGE 29 AGE        291-13539.7169-0.132324866539.8663674-25.080.0000
0AGE 30 AGE        301-12261.00612-0.122064747537.9408-22.790.0000
0AGE 31 AGE        311-10811.67684-0.104877075536.4959055-20.150.0000
0AGE 32 AGE        321-9331.853508-0.086131356534.890358-17.450.0000
0AGE 33 AGE        331-8047.966748-0.069081574533.0982466-15.100.0000
0AGE 34 AGE        341-6737.015473-0.051968364531.201936-12.680.0000
0AGE 35 AGE        351-5409.257986-0.03622049527.5083801-10.250.0000
0AGE 36 AGE        361-4179.530482-0.022558388524.2580505-7.970.0000
0AGE 37 AGE        371-3038.194123-0.012260304523.1339909-5.810.0000
0AGE 38 AGE        381-1389.644267-0.003768741528.8018235-2.630.0086
0AGE 39 AGE        39000   
0STD_YYYY  2002STD_YYYY   20021-16650.53095-0.080354869996.552424-16.710.0000
0STD_YYYY  2003STD_YYYY   20031-14286.00212-0.092404093987.432746-14.470.0000
0STD_YYYY  2004STD_YYYY   20041-12407.17001-0.095531127983.6120877-12.610.0000
0STD_YYYY  2005STD_YYYY   20051-11746.07587-0.100170107981.3609237-11.970.0000
0STD_YYYY  2006STD_YYYY   20061-10098.34299-0.091994308979.7390713-10.310.0000
0STD_YYYY  2007STD_YYYY   20071-8150.321888-0.077817622978.4025271-8.330.0000
0STD_YYYY  2008STD_YYYY   20081-6771.204-0.06640663977.2427986-6.930.0000
0STD_YYYY  2009STD_YYYY   20091-6417.486667-0.063835716976.1549733-6.570.0000
0STD_YYYY  2010STD_YYYY   20101-6649.554649-0.066117202975.0897738-6.820.0000
0STD_YYYY  2011STD_YYYY   20111-6103.361286-0.054600383974.3559472-6.260.0000
0STD_YYYY  2012STD_YYYY   20121-5366.468102-0.042711614973.5318086-5.510.0000
0STD_YYYY  2013STD_YYYY   20131-4708.935048-0.032176676972.8157802-4.840.0000
0STD_YYYY  2014STD_YYYY   20141-3626.385435-0.020955799972.0437018-3.730.0002
0STD_YYYY  2015STD_YYYY   20151-3132.691922-0.014746356969.0205189-3.230.0012
0STD_YYYY  2016STD_YYYY   20161-2790.127585-0.00996555969.1815037-2.880.0040
0STD_YYYY  2017STD_YYYY   20171-2300.810792-0.00577359974.814409-2.360.0183
0STD_YYYY  2018STD_YYYY   20181-1647.516408-0.002507904999.3242518-1.650.0992
0STD_YYYY  2019STD_YYYY   2019000   
1Intercept   Intercept163280.455580850.48709374.400.0000
1EVENT_TIME-3  EVENT_TIME -31994.34186260.008055379101.14868029.830.0000
1EVENT_TIME-2  EVENT_TIME -211215.8942720.00984812795.4516136612.740.0000
1EVENT_TIME0  EVENT_TIME 01-6843.483011-0.05529169694.85320156-72.150.0000
1EVENT_TIME1  EVENT_TIME 11-17267.81526-0.13546187498.94973511-174.510.0000
1EVENT_TIME2  EVENT_TIME 21-19545.15122-0.155900401101.849245-191.900.0000
1EVENT_TIME3  EVENT_TIME 31-20748.45919-0.165749227106.0720896-195.610.0000
1EVENT_TIME4  EVENT_TIME 41-22258.63616-0.177409728110.9774559-200.570.0000
1EVENT_TIME5  EVENT_TIME 51-23210.70219-0.185285274116.9501046-198.470.0000
1EVENT_TIME-1  EVENT_TIME -1000   
1AGE 22 AGE        221-37718.49845-0.068051731668.144711-56.450.0000
1AGE 23 AGE        231-35748.9006-0.101599922599.7267032-59.610.0000
1AGE 24 AGE        241-32940.93284-0.126637202576.2575101-57.160.0000
1AGE 25 AGE        251-30165.94661-0.147222185564.6762622-53.420.0000
1AGE 26 AGE        261-27665.34236-0.16156506557.9669949-49.580.0000
1AGE 27 AGE        271-25559.05246-0.171838212553.2894143-46.190.0000
1AGE 28 AGE        281-23612.52525-0.173613597549.8253636-42.950.0000
1AGE 29 AGE        291-21537.26904-0.166900789546.9335527-39.380.0000
1AGE 30 AGE        301-19520.55581-0.155215734544.2995877-35.860.0000
1AGE 31 AGE        311-17306.22797-0.135745804542.2007501-31.920.0000
1AGE 32 AGE        321-15069.50123-0.113959816539.9454294-27.910.0000
1AGE 33 AGE        331-12922.59306-0.092519626537.4588657-24.040.0000
1AGE 34 AGE        341-10691.52796-0.07045734534.77624-19.990.0000
1AGE 35 AGE        351-8369.566899-0.048821541530.1984657-15.790.0000
1AGE 36 AGE        361-6214.63083-0.029862688526.2921207-11.810.0000
1AGE 37 AGE        371-4101.209234-0.015029863524.639301-7.820.0000
1AGE 38 AGE        381-2134.609388-0.005332029529.9816263-4.030.0001
1AGE 39 AGE        39000   
1STD_YYYY  2002STD_YYYY   20021-16791.17786-0.0580286941029.079642-16.320.0000
1STD_YYYY  2003STD_YYYY   20031-14332.50796-0.0683462071015.028098-14.120.0000
1STD_YYYY  2004STD_YYYY   20041-12365.53029-0.0720080311009.390556-12.250.0000
1STD_YYYY  2005STD_YYYY   20051-12066.34564-0.079406331006.206493-11.990.0000
1STD_YYYY  2006STD_YYYY   20061-10180.47238-0.0725311781004.021839-10.140.0000
1STD_YYYY  2007STD_YYYY   20071-7857.902214-0.0592751621002.274346-7.840.0000
1STD_YYYY  2008STD_YYYY   20081-6173.653216-0.0481134051000.796619-6.170.0000
1STD_YYYY  2009STD_YYYY   20091-6142.298686-0.048723706999.4355283-6.150.0000
1STD_YYYY  2010STD_YYYY   20101-5945.250427-0.047334151998.0998518-5.960.0000
1STD_YYYY  2011STD_YYYY   20111-5474.527188-0.040184299997.1011941-5.490.0000
1STD_YYYY  2012STD_YYYY   20121-4632.716016-0.030845737996.0327699-4.650.0000
1STD_YYYY  2013STD_YYYY   20131-4340.177422-0.025316809995.103842-4.360.0000
1STD_YYYY  2014STD_YYYY   20141-3545.840451-0.017710699994.2624963-3.570.0004
1STD_YYYY  2015STD_YYYY   20151-2930.668589-0.012085427990.6911644-2.960.0031
1STD_YYYY  2016STD_YYYY   20161-2804.046552-0.008861841991.2889451-2.830.0047
1STD_YYYY  2017STD_YYYY   20171-2246.379304-0.005073097997.3880462-2.250.0243
1STD_YYYY  2018STD_YYYY   20181-1946.538475-0.0026982231022.993846-1.900.0571
1STD_YYYY  2019STD_YYYY   2019000   

 

Now, there's a problem in glm results.

 

I have no idea why this problem happened.

Can you give any information or suggestion? Or is there any pages that I can see each steps of how weights are applied in the regression?

10 REPLIES 10
jhmoon
Obsidian | Level 7
And I use SAS Enterprise Guide!
Rick_SAS
SAS Super FREQ

What version of SAS are you running? For example, submit the following statement and copy/paste the answer from the log:
%put &=SYSVLONG;

jhmoon
Obsidian | Level 7
It's SAS Enterprise Guide 7.15.
Rick_SAS
SAS Super FREQ

We need the version of SAS, not the version of EG. Please submit the SAS statement in my previous post and report the results in the log.

Rick_SAS
SAS Super FREQ

To help us figure out the cause, can you please

 

1. Use a QUIT statement in the GLM step.

2. Modify the GLMSELECT step to explicitly specify the reference levels and the GLM parameterization. 

CLASS EVENT_TIME(REF='-1') AGE(REF='39') STD_YYYY(REF='2019') / param=GLM;

Do you get the same parameter estimates?

Rick_SAS
SAS Super FREQ

This could be a data-dependent problem caused by having the same (or very small) weights for the STD_YYYY variable. We should look at the distribution of weights for each level of the STD_YYYY variable. Please run the following and post the results.

 

proc means DATA=IPW.TREAT_BASE_SAMPLE_CHT70 ;
   where not cmiss(Event_time, Age);
   class STD_YYYY;
   var C1_WEIGHT;
run;

proc sgplot DATA=IPW.TREAT_BASE_SAMPLE_CHT70 ;
   where not cmiss(Event_time, Age);
   vbox C1_WEIGHT / category= STD_YYYY;
run;
jhmoon
Obsidian | Level 7
Sorry for late replying.
I have to export the result file and it takes several days.
I'll reply right after the file is exported.
jhmoon
Obsidian | Level 7

Thank you for replying and suggestion, Rick.

 

Here's the result for your suggestions.

 

1. SAS version

%put &=SYSVLONG;

--> SYSVLONG=9.04.01M8P011823

 

2.  To help us figure out the cause, can you please

 

1. Use a QUIT statement in the GLM step.

2. Modify the GLMSELECT step to explicitly specify the reference levels and the GLM parameterization. 

CLASS EVENT_TIME(REF='-1') AGE(REF='39') STD_YYYY(REF='2019') / param=GLM;

Do you get the same parameter estimates?

 

--> yes, it shows exactly same results.

 

3.  "This could be a data-dependent problem caused by having the same (or very small) weights for the STD_YYYY variable. We should look at the distribution of weights for each level of the STD_YYYY variable. Please run the following and post the results."

 

 

 

proc means DATA=IPW.TREAT_BASE_SAMPLE_CHT70 ;
   where not cmiss(Event_time, Age);
   class STD_YYYY;
   var C1_WEIGHT;
run;

proc sgplot DATA=IPW.TREAT_BASE_SAMPLE_CHT70 ;
   where not cmiss(Event_time, Age);
   vbox C1_WEIGHT / category= STD_YYYY;
run;

 

 

 

--> Here's my code and results below:

/*RICK'S SOLUTION TO CHECK*/
PROC MEANS DATA=IPW.TREAT_BASE_SAMPLE_CHT70 ;
	WHERE NOT CMISS(EVENT_TIME, AGE);
	CLASS STD_YYYY;
	VAR C1_WEIGHT;
RUN;

ODS GRAPHICS ON / OBSMAX=5882292;

PROC SGPLOT DATA=IPW.TREAT_BASE_SAMPLE_CHT70 ;
	WHERE NOT CMISS(EVENT_TIME, AGE);
	VBOX C1_WEIGHT / CATEGORY= STD_YYYY;
RUN;

jhmoon_6-1703735862289.pngjhmoon_1-1703735273729.png

 

In addition, I follow your suggestion with AGE instead of STD_YYYY

jhmoon_5-1703735819594.pngjhmoon_3-1703735337812.png

 

You mentioned in last replying that it could be caused by having same weight.

But, I am still wondering why there are different results between 'glm' and 'glmselect'.

Even if it is a problem of weights, I think both codes should report the same results.

 

Thank you

Rick_SAS
SAS Super FREQ

Thanks for the additional information.

  • It looks like you are using 9.4M8, which is the latest software.
  • For several categories, the weights are constant, but the constant is not zero.

I do not know why you are seeing this issue. I suggest you contact SAS Technical Support and work with them to create an example that the developers at SAS can use to reproduce the problem.

 

> Even if it is a problem of weights, I think both codes should report the same results.

Yes, you are correct. The two procedure calls should produce the same results, as far as I can tell.

jhmoon
Obsidian | Level 7
Thank you for your help, RIck.
Then, I will contact Technical Support team, following your suggestion.

sas-innovate-wordmark-2025-midnight.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.


Register now!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 10 replies
  • 2554 views
  • 2 likes
  • 2 in conversation