Run 4 basic correlations on 324 different filters.

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

rdmarchand
Posts: 2
Joined: Wed Aug 22, 2012 3:10 pm

Run 4 basic correlations on 324 different filters.

Postby rdmarchand » Wed Aug 22, 2012 3:25 pm

Hi there,

I'm relatively new to using SPSS and this is my first time on the forum so please ease me in gently! I am currently wondering if there is a quick way of undertaking what would otherwise be a lengthy interrogation of a data set.

I have a dataset at a Lower Super Output Area (LSOA) level. These 32482 LSOA's can be grouped together to form 324 Local Authorities.

At this stage of my work all I am doing is drawing out the correlation between 4 different statistics reported in the data. I have done this at a National level and it has given interesting and slightly unexpected results. To explore this further I would like to consider the same correlations, but this time on each individual local authority. I have set up dichotomous variables for each of the local authorities to enable filtering. An example of the code I then want to run (using one of the local authorities) is

Code: Select all

FILTER BY FSHFFLD.
DESC VARS = ALL

FREQ VARS = ALL /FORMAT = NOTABLE /HISTOGRAM 

*Correlate all numerical variables with Overall IMD Score.

CORRELATIONS 
 /variables = IMD with HSEHOLDS FPHOUSE PCTFP INC EMP HLTHDEP EDSKLL BRHSNG CRIME 
 LIVENV NPCTFP NIMD NINC NEMP NHLTHDEP NEDSKLL NBRHSNG NCRIME NLIVENV
 /statistics = ALL.

*Correlate all numerical variables with percentage Fuel Poverty figures.

CORRELATIONS 
 /variables = PCTFP with HSEHOLDS FPHOUSE IMD INC EMP HLTHDEP EDSKLL BRHSNG CRIME 
 LIVENV NPCTFP NIMD NINC NEMP NHLTHDEP NEDSKLL NBRHSNG NCRIME NLIVENV
 /statistics = ALL.

*Correlate all numerical variables with number of Fuel Poor Households.

CORRELATIONS
 /variables = FPHOUSE with HSEHOLDS PCTFP IMD INC EMP HLTHDEP EDSKLL BRHSNG CRIME 
 LIVENV NPCTFP NIMD NINC NEMP NHLTHDEP NEDSKLL NBRHSNG NCRIME NLIVENV
 /statistics = ALL.

FILTER OFF.
I want to run this 323 more times, the identical code with a different filter applied each time. Is there a way of utilising a function such as DO REPEAT to save manually entering each of the different filters?

I hope this makes sense, and thanks for your help and advice.
statman
Administrator
Posts: 2700
Joined: Tue Jun 12, 2007 12:08 pm
Location: Florida, USA

Re: Run 4 basic correlations on 324 different filters.

Postby statman » Wed Aug 22, 2012 11:30 pm

Look into the SPLIT file function to see if this can be applied
See the note below

NOTE: Please read the Posting Guidelines and always tell us your OS, the SPSS version and information about your study and data!

Statman
Statistical Services
rdmarchand
Posts: 2
Joined: Wed Aug 22, 2012 3:10 pm

Re: Run 4 basic correlations on 324 different filters.

Postby rdmarchand » Thu Aug 23, 2012 11:41 am

Brilliant - thanks statman. As usual I was looking for an overly complex answer, when instead one function allowed me to achieve what I needed in 30 seconds.

Thanks!

Who is online

Users browsing this forum: No registered users and 3 guests

cron