Introduction to the British Social Attitudes Survey

Practical exercises

UK Data Service 21 September 2016

QUESTION SHEETS

Exploring internet use, trust and political affiliation using BSA 2013

1. Finding out about the dataset using documentation

Go to the UK Data Service website www.ukdataservice.ac.uk. Find the British Social Attitudes Survey from among the Key surveys via the Get data menu. Click on the title of the survey to go to the Series page. Under DATA ACCESS, click on the survey name and from the list that appears, click on BSA 2013 to go to the catalogue page for the BSA 2013.

The catalogue page gives summary information about the survey, contains detailed documentation from the survey providers and links to download the data.

TASK: Explore the BSA 2013 catalogue page to find out more about the data

Q1. Where do you click to download the data? (but don’t download the data now)

Q2. What extra modules were included in the BSA in 2013?

Scroll down to find the and user guide. If you have time, you can explore these documents to see what they contain. They are searchable using Control-F.

Q3. What is the name of the weighting variable in the BSA?

1 Introduction to the British Social Attitudes Survey 2013 using PSPP: Question sheet 2. Exploring survey data online in Nesstar

Nesstar is a tool that allows you to explore survey data online. You can also conduct some basic analyses, create graphs and download subsets of the data in Nesstar. Anyone can explore the variables in Nesstar but for most other tasks you must log in to the UK Data Service first.

We will use Nesstar to explore a few variables in the BSA 2013.

TASK: Explore the British Social Attitudes 2013 data online using Nesstar

To get to Nesstar from the BSA 2013 catalogue page, scroll to the top of the page and near the top right, following the link ‘explore online’:

To navigate in Nesstar, use the left hand pane. The BSA 2013 should already be open in the list of datasets in the left hand pane and survey information is displayed in the right pane.

Click on the + sign next to Variable Description to see the categories of variables in the BSA 2013. Find the variables for internet use in ‘Newspaper Readership and the Internet’. Look at the variable: Does anyone have access to the internet at this address? (click on the question in the left hand pane and information should appear in the right hand pane):

Q4. How many answered that they use the internet or World Wide Web for any reason (other than their work)? :Q246

2 Introduction to the British Social Attitudes Survey 2013 using PSPP: Question sheet

Q5. Did anyone say they didn’t know or refused to answer?

Q6. What are the codes for the ‘Don’t know’ and ‘Refusal’ responses for this variable? ie what are the numbers assigned to those categories?

Now go to the next variable (about the number of hours they spend on the internet per week other than for work, Q247):

Q7. Did anyone say they didn’t know or refused to answer this question?

Q8. What are the codes for the ‘Don’t know’ and ‘Refusal’ responses for this variable? ie what are the numbers assigned to those categories?

Q9. What is the range of valid (non-missing) values for this variable? ie what is the smallest number of hours and the largest number of hours?

Q10. Looking at the SUMMARY STATISTICS below the table, how many missing cases are there for this question?

Q11. Can you see why there are so many missing cases? (Look at the UNIVERSE section at the bottom of the page)

3 Introduction to the British Social Attitudes Survey 2013 using PSPP: Question sheet 3. Using PSPP

TASK: Indicates a practical task for you to complete PSPP: Indicates an action required in PSPP

3.1 PSPP

PSPP is an open source (free) statistics software that has an interface very similar to SPSS but with a smaller range of features.

We have provided PSPP on the laptops for the course today, but you can download it on your own computer from: https://www.gnu.org/software/pspp/get.html

The data for today’s practical is the 2013 British Social Attitudes Survey which is already loaded onto your computer. If you would like to use this data after this course, you can download it from the UK Data Service after a quick registration process: https://discover.ukdataservice.ac.uk/catalogue/?sn=7500&type=Data%20catalogue

TASK: Open and explore the data in PSPP

PSPP: Find PSPP the dataset ‘BSA2013’ on the desktop and double click to open it in PSPP - it will open automatically.

3.2 The data editor Data in PSPP is stored in the Data Editor. This has two views, the Data View and the Variable View. The tabs on the bottom left corner of the data editor allow you to select the view you want .

PSPP: Click on the Data View tab at the bottom left of the screen.

The Data View shows your data. Each column represents a different variable. Each row contains data from a single respondent (this may be a person, a household, business, school, etc). In BSA 2013, each row is the data for a person.

Each cell (or box) contains data from the column variable for the respondent in that row. The shaded cell below shows the Country variable for the 5th person in the dataset:

4 Introduction to the British Social Attitudes Survey 2013 using PSPP: Question sheet

PSPP: You can see which country is represented by ‘1’ by pressing the value labels icon in the top menu.

PSPP: Click on Variable View tab at the bottom left of the screen.

The Variable View provides details of the variables in your dataset. Each row now represents a variable. The Country variable is highlighted below.

In Variable View, you can see more information about the type of variable, the name (the short name used to identify the variable), the label (the longer name, often the full question

5 Introduction to the British Social Attitudes Survey 2013 using PSPP: Question sheet from the survey questionnaire), whether it is numeric, or string (text variables), or a date, for example.

In the Value Labels column, you can see the values that have been assigned to the different values of a variable, for example which values represent which area in the variable “Government office region 2003 version: Q20” (GOR 2).

The Missing column shows any values which have been allocated as missing in PSPP. Any cases with missing values will not be included in the analysis.

Measure shows whether a variable is scalar or continuous, such as people’s age, nominal, an unranked categorical variable (e.g. Country), or ordinal, a ranked categorical variable (e.g. a Likert scale of agreement) 1 – Agree strongly 2 – Agree 3 – Neither agree nor disagree 4 – Disagree 5 – Disagree Strongly

You can also find out more about the variables by using the Variables window. Use Utilities > Variables…to open the variables dialogue box:

The list of variables in the variables box can contain the short name of the variable or the longer and more descriptive label. It is easier to use the name than the label in PSPP commands.

6 Introduction to the British Social Attitudes Survey 2013 using PSPP: Question sheet PSPP: In most dialog boxes, if you see the longer descriptive label, just right-click in the list of variables and choose ‘Prefer Variable Names’. (PSPP in fact always says Prefer Variable Labels but allows you to move between variable names and labels)

Quick tip: You can easily find a variable from a long list in a dialog box by clicking into the list and typing the first few letters of the variable.

PSPP: Select any variable in the left hand pane, then type ‘cou’ and PSPP will take you to the first variable that starts ‘cou’, in this case, country.

3.2 The Output Window

To run an analysis, you can use drop down menus. We will run a simple analysis and look at how we see the results.

PSPP: Click on Analyse, then Descriptive Statistics, then Frequencies…

You will see the following Frequencies dialog box appear.

PSPP: Select GOR2, the Government office region, then click on the arrow to add this to the Variable(s) box and click OK.

7 Introduction to the British Social Attitudes Survey 2013 using PSPP: Question sheet

Your results appear in the ‘Output’ window. You can find this via the taskbar at the bottom of your screen.

The results of all your statistical analyses appear in the Output window. The Output window below shows a table of responses to a question on region. The left panel lists the analyses you have undertaken to help you navigate through your results. You can export the Output window to save your results.

8 Introduction to the British Social Attitudes Survey 2013 using PSPP: Question sheet

PSPP: Go to ‘Frequencies’ again and you will see that the same Frequencies dialog box appears already filled in exactly as you last used it.

TASK: Looking at the data in the data view and variable view, answer the following questions about the data.

Q12. How many variables are there in the dataset?

Q13. How many cases are there?

Q14. What is the coding for the variable RSex (respondent sex)? The codes are the numbers associated with each category.

Q15. What is the coding for the variable Country?

Q16. Is Country a scalar, nominal or ordinal variable?

TASK: In Variable View, jump to the variable Wronglaw using the button .

Q17. What does the variable Wronglaw measure?

9 Introduction to the British Social Attitudes Survey 2013 using PSPP: Question sheet

4. Weighting your data

You should always weight your data before you analyse it. This is so the data better reflects the population you are examining.

To weight data:

1) Click on the symbol

2) Select ‘WtFactor’, press then ‘OK’

10 Introduction to the British Social Attitudes Survey 2013 using PSPP: Question sheet

5. Exploring one variable at a time

In this exercise we will explore the following variables:

 Internet access (Internet), a categorical variable

 Time spent using the Internet each week (WWWHrsWk), a continuous variable

Suppose we want to know what percentage of households had access to the internet in 2013. What does the BSA tell us about this?

TASK: Produce a frequency table of the variable Internet (internet access)

PSPP: Click on Analyse, then Descriptive Statistics, then Frequencies…

PSPP: Select Internet then click on the arrow to add this to the Variables box and then click OK.

11 Introduction to the British Social Attitudes Survey 2013 using PSPP: Question sheet Q18. What percentage of households have Internet access?

TASK: Declare missing data for the internet variable and redo the frequency table

The frequency table you found includes a “Don’t know” response. It may be better to exclude this response from analysis by setting it to missing (ie telling PSPP that ‘Don’t know’ is a missing value).

PSPP: Go back to the data via the windows at the bottom of the screen. Click the Variable View button near the bottom left:

Use the Variables tool button to find the variable internet. This tool button is the alternative to menu: Utilities – Variables. Look at the coding for ‘Don’t know’ and ‘Refusal’ in the Value Labels box and note down their values then click on ‘Go To’ to go to the variables view.

Note: You should see the box displayed as above. In my copy of PSPP, the right pane is unreadable after the first use so you can’t see the value labels in the box. If this happens, go to the variable in the variable view by pressing ‘Go To’ and look at the value labels in the Value Labels column.

In the variables view, open the dropdown menu in the Missing Values column of the variable. This opens the Missing Values window. Click on Discrete missing values, and enter the values 8 and 9 to set them to missing and press OK.

12 Introduction to the British Social Attitudes Survey 2013 using PSPP: Question sheet

Now run your Frequency table again.

Q19. What percentage of households have Internet access (using the Valid Percent)? Did what you did make any difference to your answer – if not, why not?

Another way to show the frequencies is in a bar chart.

TASK: Produce a bar chart of Internet access in the household using the variable Internet. Bar charts provide a visual representation of the responses to a categorical variable.

PSPP: Click on Analyse, then Descriptive Statistics, then Frequencies…

PSPP: The variable Internet should already be selected. Click on the Charts… button then choose Percentages (in Chart Formatting) and Bar Charts , click Continue and finally click OK

13 Introduction to the British Social Attitudes Survey 2013 using PSPP: Question sheet

Now suppose we want to explore the number of hours that people spend on the internet using the variable WWWHrsWk.

TASK: First check that the missing values have been declared in PSPP for the variable WWWHrsWk

PSPP: Use the Variables tool button to to go the variable WWWHrsWk in the Variable View. Look at the missing values coding in the Value Labels column and note their values. Alter the values in the Missing Values column of the variable so that values -1, 998 and 999 are missing values using either the Discrete missing values option or the Range plus one discrete missing value option.

TASK: Produce descriptive statistics (mean, minimum, maximum, standard deviation) for the variable WWWHrsWk. These provide detail about how your variable is distributed and are used for continuous or scalar variables.

PSPP: Click on Analyse, then Descriptive Statistics, then Descriptives…

14 Introduction to the British Social Attitudes Survey 2013 using PSPP: Question sheet

PSPP: Select WWWHrsWk then click on the arrow to add this to the Variables box. In the Statistics box, the mean, standard deviation, minimum and maximum should already be selected. Click OK.

Q20. What is the mean number of hours spent using the Internet each week?

15 Introduction to the British Social Attitudes Survey 2013 using PSPP: Question sheet

Q21. What does the standard deviation add to your understanding of the distribution?

Q22. How could you find what proportion of people reported spending more than 100 hours per week using the Internet?

Histograms are graphs that show the distribution of continuous or scalar variables.

TASK: Produce a histogram for the variable WWWHrsWk.

There are two ways to create Histograms in PSPP which produce graphs that look slightly different.

PSPP: To create a histogram via the Frequencies dialog box, click on Analyse, then Descriptive Statistics, then Frequencies. Select WWWHrsWk (if it is not already selected) then click on the arrow to add this to the Variables box. Click on the Charts button. Choose Draw histograms then click Continue then OK.

16 Introduction to the British Social Attitudes Survey 2013 using PSPP: Question sheet PSPP: To create a histogram via the Graphs drop down menu, click on Graphs, then Histogram. Select WWWHrsWk then click on the arrow to add this to the Variable box, then click OK.

Q23. Can you see what the difference between the two histograms is? It is the same data.

Q24. How would you describe the distribution of this variable?

17 Introduction to the British Social Attitudes Survey 2013 using PSPP: Question sheet

6. Exploring two variables together

6.1 Exploring two categorical variables

In this exercise we will look at variables relating to social trust using the following variables:

 Respondent trusts other people (SocTrust), a categorical variable.   Respondent’s gender (RSex), a categorical variable.

 Political party (Partyid1), a categorical variable.

Social trust and gender

TASK: Examine the variable about social trust (SocTrust) and see whether it varies between men and women.

PSPP: Use frequency tables to examine each of the variable SocTrust and RSex to make sure that missing values have been dealt with correctly in the dataset. In the missing values column of the Variables View, alter the missing values for those variables if they are not correct.

PSPP: Create a frequency table of SocTrust.

Q25. What does the frequency table tell you about trust in other people in Britain in 2013?

Most people (61%) say that you can’t be too careful in dealing with people.

PSPP: Now create a cross-tabulation (crosstab) of SocTrust by RSex. Use Analyse, Descriptives, Crosstabs… and put SocTrust in the rows and RSex in the columns. Click on the Cells… button and select Count and Column percentages. Click on Continue, then OK.

Q26. What does the crosstab tell you about the association between trust in other people in Britain and gender?

18 Introduction to the British Social Attitudes Survey 2013 using PSPP: Question sheet Social trust and political affiliation

We might be interested in examining how trust is associated with political affiliation. The BSAS asks people whether they support a particular party but there are too many response options to easily examine at once. We can recode them into broader groups to make analysis easier.

TASK: Recode the political affiliation variable Partyid1 into fewer categories for easier analysis. Call it something appropriate like party_rec – instructions below.

Before recoding a variable, we must first be clear about how that variable is coded.

To find the coding for Partyid1, you can press the variables dialog box (Utilities > Variables…) or go to the Variable View then click on the Values column for the variable you are interested in.

You must then decide which categories you want to create for the new variable. To help avoid mistakes, it is a good idea to write out the codes and labels for the old variable and new as show below for example.

There are various ways we might recode the political affiliation variable. For the purposes of this exercise the following 6 category recode is suggested, but you could make up your own:

Old variable New variable ‘Partyid1’ ‘party_rec’

Value Label Value Label

1 Conservative 1 Conservative 2 Labour 2 Labour 3 Liberal Democrat 3 Liberal Democrat 6 Scottish National Party 7 Plaid Cymru 4 Other affiliation 8 Other party 9 Other answer 10 None 5 No political affiliation 11 UK independence Party 12 British National Party 13 RESPECT 95 Green Party 98 Don’t know 6 Don’t know/refusal 99 Refusal

19 Introduction to the British Social Attitudes Survey 2013 using PSPP: Question sheet PSPP: Click on Transform then Recode into Different Variables. This ensures you keep a copy of the original variable as well as the new one. 1. Select ‘Partyid1’ from the left menu and move it across by clicking on the arrow

2. Enter name of new variable ‘party_rec’ and a label and click Change

3. Click on Old and New Values to open up a new window where you specify how values of the old version are coded in the new version

To recode a single value, click on Value under Old Value on the left and type in the current value, eg: 1 for Conservative. Next, click on Value under New Value on the right and type in the value. In the new variable ‘party_rec’, Conservative also equals 1. Finally click Add and the details of the recode will appear in the box on the right

It is also possible to recode a range of consecutive values in a single step. Here, answers of the Scottish National Party, Plaid Cymru and other party (values of 6-8) all take the same value in the new variable. Click on Range and type in the smallest value (ie: 6) in the upper box and the largest consecutive value (ie: 8) in the lower box. Under New Value on the right, click on Value and type 4, then click Add.

PSPP: When you have specified all old and new values click Continue then OK to run the recode (see the note below). Your new variable party_rec will be added at the bottom of the Variable View.

Note: Sometimes OK remains greyed out. If this happens, try pressing it a couple of times then have a look to see whether the new variable has appeared at the bottom of the variable view.

TASK: Run a frequency of the new variable party_rec 20 Introduction to the British Social Attitudes Survey 2013 using PSPP: Question sheet

Adding Value labels Your frequency table will be unclear as each party category is so far represented only by a number. So to complete the recode, you should add value labels

PSPP: Go to the Variable View window. Find the new variable party_rec at the bottom and click on the Values column. This will open up a dialogue box enabling you to enter value labels as below:

PSPP: Type in the numerical value in the Value box, then the label you want to give it in the Label box. Click Add and your label will appear in the large box. Repeat this for all labels, then click OK.

TASK: Run a crosstab of Partyid1 and party_rec to check for any recoding mistakes. Always do this after a recoding – it is very easy to make mistakes.

TASK: Run a crosstab of your recoded political affiliation variable against the trust variable ‘SocTrust’ with column percentages.

Choose the count and column percentages in the Cells button.

Q27. Reflect on what the table tells you (and doesn’t tell you) about the effect of political affiliation on trust.

21 Introduction to the British Social Attitudes Survey 2013 using PSPP: Question sheet

6.2 Exploring a continuous/scalar variable with a categorical variable

Suppose we want to look at how internet use varies by political affiliation.

TASK: Produce a table showing the mean time spent using the internet by political affiliation

PSPP: Click on Analyse, then Compare means, then Means

PSPP: Select WWWHrsWk and click on the upper arrow to place it in the Dependent List. PSPP: Select Political party (recoded) and click on the lower arrow to place it in the Independent List, then click OK

Q28. Which groups spend (a) the most time, and (b) the least time using the internet? Suggest some reasons why.

22 Introduction to the British Social Attitudes Survey 2013 using PSPP: Question sheet 6.3 Examining the relationship between two continuous/scalar variables using a scatterplot

Scatterplots are used to plot continuous variables against each other. We might be interested in how internet use varies by age.

TASK: Create a scatterplot of number of hours of internet use per week and age.

PSPP: Click on Graphs, then Scatterplot

Use the arrows to move the RAge variable into the X Axis box and move the WWWHrsWk variable into the Y axis box then click OK:

Q29. What does the scatterplot tell you about the relationship between Internet use and age? Is this what you expected to see?

One of the reasons why the relationship between the variables is not clear is that there are a lot of data points. To make the relationship clearer we could restrict the number of cases by selecting a random sample of 10% of cases and repeating the scatterplot:

PSPP: Click on Data, then Select Cases

PSPP: Select Random sample of cases, then click on ‘Sample’. Type ‘10’ into the box to select approximately 10% of all cases, click ‘Continue’ and then ‘OK’.

TASK: Repeat the scatterplot – is the relationship clearer?

23 Introduction to the British Social Attitudes Survey 2013 using PSPP: Question sheet Q30. What does the scatterplot tell you about the relationship between Internet use and age?

PSPP: Whenever you filter data like this, make sure you remember to remove the filter when you want to use the whole dataset again. Go to Data, Select Cases and select All Cases.

24 Introduction to the British Social Attitudes Survey 2013 using PSPP: Question sheet 7. Exporting your output and graphs

Exporting output

TASK: Export your results from today’s exercises.

PSPP: In the Output Viewer, use File, then Export. In the Export Output box that opens, choose a name for your output file, choose Desktop as the storage location and select either pdf or html from the list at the bottom left of the box (the default is Infer file type from extension).

You should see the html file on your desktop containing copy of your results as well as a number of .png image files of the graphs you created. To open them in Paint (say), right click on one of them and choose Open with…. Paint.

Text in graphs in PSPP

Note that PSPP sometimes cuts off text relating to graphs if the text is too long. SPSS does not have this problem. You might want to export the graphs to use them but write in your own text using Word or some other package.

SPSS does not have this problem. If we were using SPSS, you would see all the graph and text within a window in the output viewer. In addition, SPSS has interactive graphs and tables that allow you to select them and make alterations to the results e.g. change position of text, font sizes, colour.

An alternative is to use PSPP to create the data needed to create a graph and then use that data in another package (e.g. Excel) which produces attractive simple graphs and allows you to add and edit text easily.

25 Introduction to the British Social Attitudes Survey 2013 using PSPP: Question sheet 8. Syntax

You can use the syntax editor in PSPP and SPSS to write and run commands. When you use the drop down menus, behind the scenes PSPP is running syntax commands. You can see the syntax commands in the Output Viewer between your results.

TASK: Create and save a syntax file.

PSPP: In the data or variable view of the data, use File, Open Syntax to open the Syntax Viewer. Type:

FREQUENCIES /VARIABLES= Internet /FORMAT=AVALUE TABLE.

Then click on Run and then All. You should see that you have created a frequency table of the variable Internet.

PSPP: Alter the syntax you typed in so that you get a frequency table of another variable, e.g. RSex

PSPP: Type in some of the syntax you can see from your output viewer and run it. You can run all the syntax or just parts of it by selecting Run and the appropriate option.

PSPP: An alternative to typing in syntax is to press ‘Paste’ instead of ‘OK’ when you do analyses. This pastes the syntax for your analysis into the syntax editor but you have to select the commands and press run to run the analyses in this way.

PSPP: Try running some analyses using the drop down menus using Paste instead of OK.

PSPP: Save your syntax via the File menu.

Q31. Can you see why using syntax might be better than using the drop down menus?

26 Introduction to the British Social Attitudes Survey 2013 using PSPP: Question sheet 9. Next steps

If you have SPSS at work, you might prefer to use that statistical package instead of PSPP. SPSS is a popular statistics package with a far wider range of options, graphs and analyses available. SPSS is very similar to PSPP in appearance and has similar drop down menus and syntax.

If you need to use free software, PSPP is fine for more basic analyses but you might also consider using if you find PSPP is not adequate. You can find out more information about R here: https://www.r-project.org/

R is becoming increasingly popular partly because it is free and also because it is used in by social sciences researchers but also by data scientists.

There is much material online about how to use statistics packaged. The UK Data Service has guides to SPSS: https://www.ukdataservice.ac.uk/media/342808/usingspssforwindows.pdf

Stata (another commonly used statistics package that you may have access to via your work): https://www.ukdataservice.ac.uk/media/359156/whatisstata_8.pdf and R: https://www.ukdataservice.ac.uk/media/398726/usingr.pdf

27 Introduction to the British Social Attitudes Survey 2013 using PSPP: Question sheet