Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Home
- /
- Programming
- /
- SAS Procedures
- /
- Importing SPSS weighted data

Options

- RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

🔒 This topic is **solved** and **locked**.
Need further help from the community? Please
sign in and ask a **new** question.

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Posted 06-30-2021 03:22 PM
(784 views)

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

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

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

8 REPLIES 8

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

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

Paige Miller

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

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;

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

@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

Paige Miller

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

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.

However, Reeza is suggesting that weighted data in SPSS is not altered, which makes sense considering the small sample in SAS.

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

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

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Great, thanks.

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

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

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Thanks very much Reeza, this makes sense.

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. **Registration is now open through August 30th**. Visit the SAS Hackathon homepage.

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.