HI,
Just wondering if someone can help. I'm trying to import weighted data from SPSS into SAS. The file imports, however, the weighted data does not import properly and the original sample size remains. I've tried to find this info in user manuals, but can't seem to find anything. Any ideas what I'm doing wrong?
thanks
Weighted data typically just means you have a column(s) of weights for your data. It doesn't affect the number of observations. Any proc using the data will have a WEIGHT statement where you provide the weight variable and then the analysis will factor in the weights.
It does not change your input data or data structure in any fashion.
@kristenl wrote:
HI,
Just wondering if someone can help. I'm trying to import weighted data from SPSS into SAS. The file imports, however, the weighted data does not import properly and the original sample size remains. I've tried to find this info in user manuals, but can't seem to find anything. Any ideas what I'm doing wrong?
thanks
The file imports, however, the weighted data does not import properly and the original sample size remains.
As far as I know, the data should not change when importing from SPSS to SAS, so I don't know what the above means. Can you explain this further? Can you give a small example?
Also, how are you doing this "import"?
Thanks so much for your reply. My (edited) SAS syntax is below. In the SPSS file, I have applied weights. The weighted sample is 158,000; however, after importing it into SAS, I only have the original (non-weighted) sample of 7590.
PROC IMPORT OUT=OIS.finalweighted
DATAFILE="C:\Users\...NEW_weighted.sav"
DBMS=SPSS REPLACE;
RUN;
@kristenl wrote:
Thanks so much for your reply. My (edited) SAS syntax is below. In the SPSS file, I have applied weights. The weighted sample is 158,000; however, after importing it into SAS, I only have the original (non-weighted) sample of 7590.
Do you mean that the SPSS file had 158000 records, while the SAS file has 7590 records? What does "weighted sample" mean with respect to a data set? If there is a weight variable, what happens if you add up all the weights?
It seems to me that SPSS syntax for specifying what variable to use for weighting is very similar to the SAS syntax.
https://libguides.library.kent.edu/SPSS/WeightCases
https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.3/statug/statug_freq_syntax13.htm
Great, thanks.
Weighted data typically just means you have a column(s) of weights for your data. It doesn't affect the number of observations. Any proc using the data will have a WEIGHT statement where you provide the weight variable and then the analysis will factor in the weights.
It does not change your input data or data structure in any fashion.
@kristenl wrote:
HI,
Just wondering if someone can help. I'm trying to import weighted data from SPSS into SAS. The file imports, however, the weighted data does not import properly and the original sample size remains. I've tried to find this info in user manuals, but can't seem to find anything. Any ideas what I'm doing wrong?
thanks
Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.
Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.