SAS Procedures

Help using Base SAS procedures
BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
kristenl
Calcite | Level 5

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

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User

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


 

View solution in original post

8 REPLIES 8
PaigeMiller
Diamond | Level 26

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"?

--
Paige Miller
kristenl
Calcite | Level 5

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;

PaigeMiller
Diamond | Level 26

@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?

--
Paige Miller
kristenl
Calcite | Level 5
Yes, that's correct - SPSS file had 158,000, whereas SAS had 7590.
However, Reeza is suggesting that weighted data in SPSS is not altered, which makes sense considering the small sample in SAS.
Tom
Super User Tom
Super User

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

 

 

kristenl
Calcite | Level 5

Great, thanks.

Reeza
Super User

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


 

kristenl
Calcite | Level 5
Thanks very much Reeza, this makes sense.

sas-innovate-white.png

Our biggest data and AI event of the year.

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.

 

Register now!

What is Bayesian Analysis?

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 8 replies
  • 2738 views
  • 0 likes
  • 4 in conversation