## Calculate unemployment rate for several years and regions using weights

Frequent Contributor
Posts: 79

# Calculate unemployment rate for several years and regions using weights

I have

YEAR, which is 2014 or 2015

STATUS, which 1=employed 2=unemployed 3=not in labourforce

FINALWT, which is the weight

REGION, which is the region

All I want is a table by year and region calculating the proportion with status 'unemployed' (and the sum of unemployed--but this could be a separate table) over the total of all people.

SAS Super FREQ
Posts: 4,241

## Re: Calculate unemployment rate for several years and regions using weights

Are these sampling weights? If so, take a look at PROC SURVEYFREQ. I am not a survey statistician myself, but I think the syntax might be

``````proc surveyfreq data=MySurvey;
by year;
tables Status;
strata  Region;
weight  FinalWt;
run;``````
Frequent Contributor
Posts: 79

## Re: Calculate unemployment rate for several years and regions using weights

the thing with this is that unemployment rate is "unemployed / (employed+unemployed)"

So I can't just get it to spit out unemployed as a proportion of the total population.

The percentage has to be of Status 1+2

Super User
Posts: 13,542

## Re: Calculate unemployment rate for several years and regions using weights

It may help to show what you tried and what you were not satisfied about the results.

It would help to provide a small example data set and what the results for that should look like. Obvious pick a small enough set that you can calculate the result by hand. HINT: do not make all of the values 1 or 2.

The way your coding looks you can't get a "sum" of unemployed though a count should be possible.

If the weights come from a probability sample and is other than a simple random sample you will likely want to use one of the survey proceddures either freq or means. There would need to be more information about how the data were collected in that case such as sample methodology, sample frame and statification or cluster information.

I would think something like:

``````proc tabulate data=have;
class year status region;
weight finalwt;
table region*status,
year *(n pctn)
;
run;``````

we be a reasonable start.

Frequent Contributor
Posts: 79

## Re: Calculate unemployment rate for several years and regions using weights

Unfortunately this does not use the weights (for whatever reason)...

Discussion stats
• 4 replies
• 395 views
• 0 likes
• 3 in conversation