10-17-2016 04:19 PM
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.
I've tried tabulate, freq, and summary but I'm at my witts end. Could someone please help?
10-18-2016 11:14 AM
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;
10-19-2016 10:30 AM
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
10-18-2016 12:46 PM
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.