turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

- Home
- /
- SAS Programming
- /
- SAS Procedures
- /
- Bootstrapping

Topic Options

- RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

02-19-2018 01:57 PM

I need help with the codes for determining sample size for independent t tests by bootstrapping. I calculated the sample size by hand and got 62. My mu1=8, mu2=15 std dev.=12, alpha=0.05 and 1-beta=0.9.

Thank you.

Accepted Solutions

Solution

03-23-2018
05:39 PM

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to Uche_Okoro

02-20-2018 07:29 AM

The general idea is shown in "Using simulation to estimate the power of a statistical test." That example uses simulation to generate the many (re)samples, but you can replace the simulation step by using the bootstrap resampling. A general discussion of bootstrapping in SAS is available at "Compute a bootstrap confidence interval in SAS".

If this is a MATCHED t-test, then you should use a permutation test, as shown in "Resampling and permutation tests in SAS".

All Replies

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to Uche_Okoro

02-19-2018 02:23 PM

Please see the fully worked example here:

If you have more specific issues with your PROC POWER, please post back with the code you tried and explain what issues you're having.

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to Reeza

02-19-2018 04:09 PM

Thank you for prompt response but it does not have a closed-form solution.

By bootstrapping, I am to estimate the sample size that will give me a

power of 90%. I know from the initial calculation I got 62. I am expected

to start with eg 30 run simulations 1000 times using the independent t-test

then check the p-value each time. if I reject that could be coded as 1 when

fail to reject, I code that as 0. I am to do that a 1000 times, then take

an average of the variables which is the power. I am to continue increasing

the sample size and the power is expected to increase as I do so. Then stop

at a sample size that gives me a power of 90%.

I need a sas code to enable me so do.

Thank you again.

By bootstrapping, I am to estimate the sample size that will give me a

power of 90%. I know from the initial calculation I got 62. I am expected

to start with eg 30 run simulations 1000 times using the independent t-test

then check the p-value each time. if I reject that could be coded as 1 when

fail to reject, I code that as 0. I am to do that a 1000 times, then take

an average of the variables which is the power. I am to continue increasing

the sample size and the power is expected to increase as I do so. Then stop

at a sample size that gives me a power of 90%.

I need a sas code to enable me so do.

Thank you again.

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to Uche_Okoro

02-20-2018 07:35 AM

If you have SAS 9.4M5, you can use the new BOOTSTRAP statement in PROC TTEST:

Solution

03-23-2018
05:39 PM

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to Uche_Okoro

02-20-2018 07:29 AM

The general idea is shown in "Using simulation to estimate the power of a statistical test." That example uses simulation to generate the many (re)samples, but you can replace the simulation step by using the bootstrap resampling. A general discussion of bootstrapping in SAS is available at "Compute a bootstrap confidence interval in SAS".

If this is a MATCHED t-test, then you should use a permutation test, as shown in "Resampling and permutation tests in SAS".