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
- /
- Analytics
- /
- Stat Procs
- /
- proc surveyselect - OPTIMAL ALLOCATION

Topic Options

- Subscribe to 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
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

10-13-2015 07:54 AM

In SURVEYSELECT you can requests optimal allocation, which allocates the total sample size

among the strata in proportion to stratum sizes and stratum variances.

You can use the option ALLOC=OPTIMAL and give the stratum variances with VAR=(values). The question: Is possible to use it with many variables? (many variances for each stratum) Thanks and regards!

Accepted Solutions

Solution

10-14-2015
03:35 AM

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

10-13-2015 11:24 PM

The short answer is no. You could however provide **proc surveyselect** with a measure of the overall variance of your variables. The determinant of the covariance matrix of your variables can be considered as such an estimate of the overall variance. It can be calculated for each strata by **proc discrim**. Use **ODS** to transfer the information from **discrim** to **surveyselect**. This example shows you how:

```
proc sort data=sashelp.class out=myClass; by sex; run;
/* Get the determinant of the covariance matrix within each stratum */
ods select LogDet;
proc discrim data=myClass pool=no noclassify;
class sex;
var weight height age;
ods output LogDet=sexLogDet;
run;
/*
Output dataset sexLogDet includes variables
FromSex : name of sex group (M or F)
LogDet : logarithm of the determinant of the covariance matrix of each stratum
*/
/* Create table containing strata variances */
proc sql;
create table sexVar as
select
FromSex as sex length=1, /* Length must match variable in myClass dataset */
exp(LogDet) as _VAR_
from sexLogDet
order by sex;
quit;
proc surveyselect data=myClass out=mySample sampsize=5;
strata sex / alloc=Neyman var=sexVar;
run;
```

PG

All Replies

Solution

10-14-2015
03:35 AM

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

10-13-2015 11:24 PM

The short answer is no. You could however provide **proc surveyselect** with a measure of the overall variance of your variables. The determinant of the covariance matrix of your variables can be considered as such an estimate of the overall variance. It can be calculated for each strata by **proc discrim**. Use **ODS** to transfer the information from **discrim** to **surveyselect**. This example shows you how:

```
proc sort data=sashelp.class out=myClass; by sex; run;
/* Get the determinant of the covariance matrix within each stratum */
ods select LogDet;
proc discrim data=myClass pool=no noclassify;
class sex;
var weight height age;
ods output LogDet=sexLogDet;
run;
/*
Output dataset sexLogDet includes variables
FromSex : name of sex group (M or F)
LogDet : logarithm of the determinant of the covariance matrix of each stratum
*/
/* Create table containing strata variances */
proc sql;
create table sexVar as
select
FromSex as sex length=1, /* Length must match variable in myClass dataset */
exp(LogDet) as _VAR_
from sexLogDet
order by sex;
quit;
proc surveyselect data=myClass out=mySample sampsize=5;
strata sex / alloc=Neyman var=sexVar;
run;
```

PG