How to combine several yearly datasets into one dataset (+ adding a time variable for time series analysis)

Moderators: statman, Analyst Techy, andris, Fierce, GerineL, Smash

Kaas-
Posts: 2
Joined: Tue Aug 09, 2016 8:48 am

How to combine several yearly datasets into one dataset (+ adding a time variable for time series analysis)

Postby Kaas- » Tue Aug 09, 2016 9:01 am

Dear all,

I have a practical question about SPSS that is really important to me. I want to combine several datasets into one dataset and I am wondering if someone can advise me on how to do that.

Description of my data:
[*] I have 30 datasets/datafiles (every one of them is a similar dataset for the years 1981, 1982, ... , 2010).
[*] In every dataset there are about 1000 entries. It is a yearly survey on 1000 people (different people every year) and you have variables such as age, gender, education etc. etc.

Description of what I want to do with the datasets:
[*] In every dataset there are about 100 variables, but I want to use only 6 of them.
[*] I want to create 1 single large dataset in which for all the 30 years, from all 30 datasets, all entries come together in 1 dataset for the specific variables that I want to use.
[*] Because I want to do time series analysis, it is necessary that in the new dataset all entries per yearly dataset get an extra variable: the year (1981, 1982, ... , 2010). The variable 'year' is not listed in the 30 individual datasets (it is onlye in the title of every individual dataset).

Example to clarify what I want to do:
[*] I now have 30 datasets in which every time 1000 people are asked about their age, gender, education etc. I want to combine all these datasets into 1 dataset in which I have all the (ca. 30.000) entries for all the variables that I need, including the variable 'year' (that is not in any individual dataset yet). I want to create this dataset with the goal to examine if I can find a trend in these 30 years in the relation between a couple of these variables.

Thank you for helping me out. All advice is very welcome (I am a bit in hurry with carrying out this research but I am stuck with my data). If my post here is not clear, then please ask me more and I will answer it asap. :)
Sgolenbro
Posts: 2
Joined: Tue Aug 09, 2016 6:31 pm

Re: How to combine several yearly datasets into one dataset (+ adding a time variable for time series analysis)

Postby Sgolenbro » Tue Aug 09, 2016 6:44 pm

1. Add in a variable (i.e. new column) in each of your data sets for the year (do it manually or w/ the COMPUTE command) - call it "YEAR" and label it 1 = 1980, 2 = 1981, etc. etc., or whatever.

2. Go to "Data" --> "Merge Files" --> "Add Cases" --> [Choose file] --> Choose the new variables you want in the new data set (e.g. whatever those 6 are). Just move them into the box to the right and paste the syntax/run it from there. Should be good to go.

Make sure those 6 variables have the same variable name in each of their respective individual files before doing that also.
Kaas-
Posts: 2
Joined: Tue Aug 09, 2016 8:48 am

Re: How to combine several yearly datasets into one dataset (+ adding a time variable for time series analysis)

Postby Kaas- » Thu Aug 11, 2016 1:57 pm

Sgolenbro wrote:1. Add in a variable (i.e. new column) in each of your data sets for the year (do it manually or w/ the COMPUTE command) - call it "YEAR" and label it 1 = 1980, 2 = 1981, etc. etc., or whatever.

2. Go to "Data" --> "Merge Files" --> "Add Cases" --> [Choose file] --> Choose the new variables you want in the new data set (e.g. whatever those 6 are). Just move them into the box to the right and paste the syntax/run it from there. Should be good to go.

Make sure those 6 variables have the same variable name in each of their respective individual files before doing that also.
Thank you for your reply Sgolenbro, it works!

Who is online

Users browsing this forum: No registered users and 3 guests

cron