From: Rick Francis on
Thank you Ya Huang! It worked, have the PARMS dataset. Could not have done
it without you! Thank you again!

Rick Francis
From: oloolo on
are u working on a multilevel model?
can you say more about "manage fixed effects with multiple levels". What
does 'MANAGE' mean here?
do you want to do a stratified sampling?

On Fri, 26 Feb 2010 13:58:21 -0500, Rick Francis <rnfrancis(a)UTEP.EDU> wrote:

>One problem (I think) with surveyselect is the inability to manage fixed
>effects with multiple levels. Hence, ultimately, I'll use GLM, with the
>boostrapped standard errors. Surveyreg will handle the cluster issue with
>the errors, but creates out of memory error message.
>
>I am grateful for all the help!!!
>
>Rick Francis
>
>
>On Fri, 26 Feb 2010 13:16:42 -0500, oloolo <dynamicpanel(a)YAHOO.COM> wrote:
>
>>bootstrap is most efficiently done via PROC SURVEYSELECT and your
>>regression model using BY statement.
>>prototype code is as following:
>>
>>ods select none;
>>proc surveyselect data=new method=urs reps=2000 samprate=1
>> out=bssamp outhits;
>>run;
>>ods select all;
>>
>>proc reg data=bssamp outest=beta noprint;
>> by Replicate;
>> model y=x;
>>run;
>>
>>
>>then you can summarize your Bootstrap estimates of statistics using the
>>beta dataset:
>>
>>proc means data=beta mean stddev;
>> var intercept x stderr;
>>run;
>>
>>
>>
>>On Fri, 26 Feb 2010 12:39:03 -0500, Rick Francis <rnfrancis(a)UTEP.EDU>
wrote:
>>
>>>Hey guys,
>>>
>>>Working to generate bootstrap estimates for standard errors from a simple
>>>OLS regression.
>>>
>>>Found a macro on the web, modified it as follows:
>>>
>>>**** Beg of Macro code ****;
>>>
>>>data new;
>>> input y x;
>>> cards;
>>> 2 6
>>> 3 6
>>> 5 7
>>> 7 9
>>> 1 4
>>> 2 9
>>> 2 8
>>> 2 9
>>> 1 9
>>> 4 10
>>> ;
>>>
>>>%MACRO boot;
>>> %DO i = 1 %to 100;
>>> DATA analysis;
>>> choice = RANUNI(&i);
>>> set new POINT = choice NOBS = 10;
>>> i+1;
>>> IF i > n THEN STOP;
>>> RUN;
>>> PROC REG DATA = analysis NOPRINT outest= outests;
>>> (KEEP= intercept x );
>>> MODEL y = x;
>>>
>>> PROC APPEND BASE = parms DATA = outests;
>>> RUN;
>>>
>>> %end;
>>>
>>> %mend;
>>> run;
>>>
>>>proc print data=parms;
>>>proc print data=outests;
>>>
>>> run;
>>>
>>>*** End of Macro Code ***;
>>>
>>>You should be able to paste this into the SAS editor, and hopefully you
>>find
>>>the same thing that I did: the macro will not execute.
>>>
>>>Not a lotta knowledge about macros, so any help is greatly appreciated!
>>>
>>>
>>>The original code from the web is as follows:
>>>
>>> %MACRO boot;
>>> %DO i = 1 %to 20;
>>> DATA analysis;
>>> choice = INT(RANUNI(23456+&i)*n)+1;
>>> SET alldata POINT = choice NOBS = n;
>>> j+1;
>>> IF j > n THEN STOP;
>>> RUN;
>>> PROC REG DATA = analysis NOPRINT OUTEST = outests
>>> (KEEP= intercep x1 x2 x3 x4 );
>>> MODEL y = x1 x2 x3 x4;
>>> RUN;
>>> PROC APPEND BASE = parms DATA = outests;
>>> RUN;
>>> %END;
>>> %MEND;
>>>
>>>The lack of initialization of the variable "j" doesn't make sense to me,
>>but
>>>again, not a lotta macro knowledge on my end.
>>>
>>>Thanks for any insight you may have!
>>>
>>>Rick Francis
From: Rick Francis on
The ultimate goal is to conduct a chow test (so need residual sums of squares).

The model used for the chow test contains two fixed effects (one with about
1600 levels, another with about 16 levels).

Reviewers will wanna see the specifics of how the model fits each piece of
the sample for the chow test.

Complicating factor is that the data contain clusters, which requires and
adjustment to the standard errors as produced by say PROC GLM.

So, what would be ideal is a procedure that could handle the multi level
data and generate Rogers-like standard errors.

SURVEYREG fits the bill here, but produces the out of memory error.

Hence, short story long, why I give up and use bootstrap standard errors for
the GLM results.

That make any sense?

Thanks for the help!!!

Rick Francis









On Fri, 26 Feb 2010 14:01:04 -0500, oloolo <dynamicpanel(a)YAHOO.COM> wrote:

>are u working on a multilevel model?
>can you say more about "manage fixed effects with multiple levels". What
>does 'MANAGE' mean here?
>do you want to do a stratified sampling?
>
>On Fri, 26 Feb 2010 13:58:21 -0500, Rick Francis <rnfrancis(a)UTEP.EDU> wrote:
>
>>One problem (I think) with surveyselect is the inability to manage fixed
>>effects with multiple levels. Hence, ultimately, I'll use GLM, with the
>>boostrapped standard errors. Surveyreg will handle the cluster issue with
>>the errors, but creates out of memory error message.
>>
>>I am grateful for all the help!!!
>>
>>Rick Francis
>>
>>
>>On Fri, 26 Feb 2010 13:16:42 -0500, oloolo <dynamicpanel(a)YAHOO.COM> wrote:
>>
>>>bootstrap is most efficiently done via PROC SURVEYSELECT and your
>>>regression model using BY statement.
>>>prototype code is as following:
>>>
>>>ods select none;
>>>proc surveyselect data=new method=urs reps=2000 samprate=1
>>> out=bssamp outhits;
>>>run;
>>>ods select all;
>>>
>>>proc reg data=bssamp outest=beta noprint;
>>> by Replicate;
>>> model y=x;
>>>run;
>>>
>>>
>>>then you can summarize your Bootstrap estimates of statistics using the
>>>beta dataset:
>>>
>>>proc means data=beta mean stddev;
>>> var intercept x stderr;
>>>run;
>>>
>>>
>>>
>>>On Fri, 26 Feb 2010 12:39:03 -0500, Rick Francis <rnfrancis(a)UTEP.EDU>
>wrote:
>>>
>>>>Hey guys,
>>>>
>>>>Working to generate bootstrap estimates for standard errors from a simple
>>>>OLS regression.
>>>>
>>>>Found a macro on the web, modified it as follows:
>>>>
>>>>**** Beg of Macro code ****;
>>>>
>>>>data new;
>>>> input y x;
>>>> cards;
>>>> 2 6
>>>> 3 6
>>>> 5 7
>>>> 7 9
>>>> 1 4
>>>> 2 9
>>>> 2 8
>>>> 2 9
>>>> 1 9
>>>> 4 10
>>>> ;
>>>>
>>>>%MACRO boot;
>>>> %DO i = 1 %to 100;
>>>> DATA analysis;
>>>> choice = RANUNI(&i);
>>>> set new POINT = choice NOBS = 10;
>>>> i+1;
>>>> IF i > n THEN STOP;
>>>> RUN;
>>>> PROC REG DATA = analysis NOPRINT outest= outests;
>>>> (KEEP= intercept x );
>>>> MODEL y = x;
>>>>
>>>> PROC APPEND BASE = parms DATA = outests;
>>>> RUN;
>>>>
>>>> %end;
>>>>
>>>> %mend;
>>>> run;
>>>>
>>>>proc print data=parms;
>>>>proc print data=outests;
>>>>
>>>> run;
>>>>
>>>>*** End of Macro Code ***;
>>>>
>>>>You should be able to paste this into the SAS editor, and hopefully you
>>>find
>>>>the same thing that I did: the macro will not execute.
>>>>
>>>>Not a lotta knowledge about macros, so any help is greatly appreciated!
>>>>
>>>>
>>>>The original code from the web is as follows:
>>>>
>>>> %MACRO boot;
>>>> %DO i = 1 %to 20;
>>>> DATA analysis;
>>>> choice = INT(RANUNI(23456+&i)*n)+1;
>>>> SET alldata POINT = choice NOBS = n;
>>>> j+1;
>>>> IF j > n THEN STOP;
>>>> RUN;
>>>> PROC REG DATA = analysis NOPRINT OUTEST = outests
>>>> (KEEP= intercep x1 x2 x3 x4 );
>>>> MODEL y = x1 x2 x3 x4;
>>>> RUN;
>>>> PROC APPEND BASE = parms DATA = outests;
>>>> RUN;
>>>> %END;
>>>> %MEND;
>>>>
>>>>The lack of initialization of the variable "j" doesn't make sense to me,
>>>but
>>>>again, not a lotta macro knowledge on my end.
>>>>
>>>>Thanks for any insight you may have!
>>>>
>>>>Rick Francis
From: Sigurd Hermansen on
Rick:
Whether or not you can use SURVEYSELECT, David Cassell's advice about resampling in SAS, particularly use of BY groups instead of explicit loops, remains valuable. See:
http://www2.sas.com/proceedings/forum2007/183-2007.pdf

I've also illustrated advantages to summarizing data using counts as weights in SAS statistical procedures. Some of the performance and memory limit problems go away when you do.
S


-----Original Message-----
From: SAS(r) Discussion [mailto:SAS-L(a)LISTSERV.UGA.EDU] On Behalf Of Rick Francis
Sent: Friday, February 26, 2010 2:28 PM
To: SAS-L(a)LISTSERV.UGA.EDU
Subject: Re: Basic Bootstrap Macro

The ultimate goal is to conduct a chow test (so need residual sums of squares).

The model used for the chow test contains two fixed effects (one with about
1600 levels, another with about 16 levels).

Reviewers will wanna see the specifics of how the model fits each piece of
the sample for the chow test.

Complicating factor is that the data contain clusters, which requires and
adjustment to the standard errors as produced by say PROC GLM.

So, what would be ideal is a procedure that could handle the multi level
data and generate Rogers-like standard errors.

SURVEYREG fits the bill here, but produces the out of memory error.

Hence, short story long, why I give up and use bootstrap standard errors for
the GLM results.

That make any sense?

Thanks for the help!!!

Rick Francis









On Fri, 26 Feb 2010 14:01:04 -0500, oloolo <dynamicpanel(a)YAHOO.COM> wrote:

>are u working on a multilevel model?
>can you say more about "manage fixed effects with multiple levels". What
>does 'MANAGE' mean here?
>do you want to do a stratified sampling?
>
>On Fri, 26 Feb 2010 13:58:21 -0500, Rick Francis <rnfrancis(a)UTEP.EDU> wrote:
>
>>One problem (I think) with surveyselect is the inability to manage fixed
>>effects with multiple levels. Hence, ultimately, I'll use GLM, with the
>>boostrapped standard errors. Surveyreg will handle the cluster issue with
>>the errors, but creates out of memory error message.
>>
>>I am grateful for all the help!!!
>>
>>Rick Francis
>>
>>
>>On Fri, 26 Feb 2010 13:16:42 -0500, oloolo <dynamicpanel(a)YAHOO.COM> wrote:
>>
>>>bootstrap is most efficiently done via PROC SURVEYSELECT and your
>>>regression model using BY statement.
>>>prototype code is as following:
>>>
>>>ods select none;
>>>proc surveyselect data=new method=urs reps=2000 samprate=1
>>> out=bssamp outhits;
>>>run;
>>>ods select all;
>>>
>>>proc reg data=bssamp outest=beta noprint;
>>> by Replicate;
>>> model y=x;
>>>run;
>>>
>>>
>>>then you can summarize your Bootstrap estimates of statistics using the
>>>beta dataset:
>>>
>>>proc means data=beta mean stddev;
>>> var intercept x stderr;
>>>run;
>>>
>>>
>>>
>>>On Fri, 26 Feb 2010 12:39:03 -0500, Rick Francis <rnfrancis(a)UTEP.EDU>
>wrote:
>>>
>>>>Hey guys,
>>>>
>>>>Working to generate bootstrap estimates for standard errors from a simple
>>>>OLS regression.
>>>>
>>>>Found a macro on the web, modified it as follows:
>>>>
>>>>**** Beg of Macro code ****;
>>>>
>>>>data new;
>>>> input y x;
>>>> cards;
>>>> 2 6
>>>> 3 6
>>>> 5 7
>>>> 7 9
>>>> 1 4
>>>> 2 9
>>>> 2 8
>>>> 2 9
>>>> 1 9
>>>> 4 10
>>>> ;
>>>>
>>>>%MACRO boot;
>>>> %DO i = 1 %to 100;
>>>> DATA analysis;
>>>> choice = RANUNI(&i);
>>>> set new POINT = choice NOBS = 10;
>>>> i+1;
>>>> IF i > n THEN STOP;
>>>> RUN;
>>>> PROC REG DATA = analysis NOPRINT outest= outests;
>>>> (KEEP= intercept x );
>>>> MODEL y = x;
>>>>
>>>> PROC APPEND BASE = parms DATA = outests;
>>>> RUN;
>>>>
>>>> %end;
>>>>
>>>> %mend;
>>>> run;
>>>>
>>>>proc print data=parms;
>>>>proc print data=outests;
>>>>
>>>> run;
>>>>
>>>>*** End of Macro Code ***;
>>>>
>>>>You should be able to paste this into the SAS editor, and hopefully you
>>>find
>>>>the same thing that I did: the macro will not execute.
>>>>
>>>>Not a lotta knowledge about macros, so any help is greatly appreciated!
>>>>
>>>>
>>>>The original code from the web is as follows:
>>>>
>>>> %MACRO boot;
>>>> %DO i = 1 %to 20;
>>>> DATA analysis;
>>>> choice = INT(RANUNI(23456+&i)*n)+1;
>>>> SET alldata POINT = choice NOBS = n;
>>>> j+1;
>>>> IF j > n THEN STOP;
>>>> RUN;
>>>> PROC REG DATA = analysis NOPRINT OUTEST = outests
>>>> (KEEP= intercep x1 x2 x3 x4 );
>>>> MODEL y = x1 x2 x3 x4;
>>>> RUN;
>>>> PROC APPEND BASE = parms DATA = outests;
>>>> RUN;
>>>> %END;
>>>> %MEND;
>>>>
>>>>The lack of initialization of the variable "j" doesn't make sense to me,
>>>but
>>>>again, not a lotta macro knowledge on my end.
>>>>
>>>>Thanks for any insight you may have!
>>>>
>>>>Rick Francis