c q e s s 1 e-science, the grid and statistical modelling in social research rob crouchley...

45
1 C Q e S S E-Science, the GRID and Statistical Modelling in Social Research Rob Crouchley Collaboratory for Quantitative e- Social Science University of Lancaster

Upload: jeremiah-fox

Post on 28-Mar-2015

220 views

Category:

Documents


3 download

TRANSCRIPT

Page 1: C Q e S S 1 E-Science, the GRID and Statistical Modelling in Social Research Rob Crouchley Collaboratory for Quantitative e-Social Science University of

1

C Q

e S

SE-Science, the GRID and

Statistical Modelling in Social Research

Rob CrouchleyCollaboratory for Quantitative e-Social Science

University of Lancaster

Page 2: C Q e S S 1 E-Science, the GRID and Statistical Modelling in Social Research Rob Crouchley Collaboratory for Quantitative e-Social Science University of

2

C Q

e S

SContents

1. The Problem/Motivation: Some Background on Statistical Methods and Social Research;

2. A Solution to part of the Problem? GRID Enabling the Analysis of Multiprocess Random Effect Response Data

• Questions.

Page 3: C Q e S S 1 E-Science, the GRID and Statistical Modelling in Social Research Rob Crouchley Collaboratory for Quantitative e-Social Science University of

3

C Q

e S

SPart 1. Some Background on

Statistical Methods and Social Research

1.Some Features of Social Science Research

2.Complications

3.A computationally demanding example

4.Sabre and Stata/MP

Page 4: C Q e S S 1 E-Science, the GRID and Statistical Modelling in Social Research Rob Crouchley Collaboratory for Quantitative e-Social Science University of

4

C Q

e S

SSome

Features of Quantitative Social Science Research

• We often want to develop evidence based substantive theory. We want to know “what determines what”, e.g. long term unemployment and social exclusion

• And we want to explore the consequences of policy changes on individual behaviour, e.g. encouragement to stay on at school on educational attainment, truancy, and social exclusion

• Our data sets are often very small (<10GB)

Page 5: C Q e S S 1 E-Science, the GRID and Statistical Modelling in Social Research Rob Crouchley Collaboratory for Quantitative e-Social Science University of

7

C Q

e S

SSocial Science Research

• Randomised experiments offer the most powerful tool to understand social processes, but outside of psychology, they are infeasible, unethical or inappropriate (e.g. for instance we can not allocate pupils to different levels of education);

• Social scientists must therefore rely on observational data from longitudinal and other surveys e.g. YCS, NCDS, BHPS, The analysis of non experimental data involves complications..

Page 6: C Q e S S 1 E-Science, the GRID and Statistical Modelling in Social Research Rob Crouchley Collaboratory for Quantitative e-Social Science University of

8

C Q

e S

SComplication 1. Cluster Effects (CE)

• Most large scale surveys use multi-stage sample designs to obtain 'representative' samples; this procedure often creates cluster effects, e.g. BHPS (households), YCS (schools);

• Pupils in the same class are often more behaviourally alike than pupils in different classes (even in the same school)

Page 7: C Q e S S 1 E-Science, the GRID and Statistical Modelling in Social Research Rob Crouchley Collaboratory for Quantitative e-Social Science University of

9

C Q

e S

SComplication 1. Cluster Effects (CE)

• Procedures have been developed to model cluster effects by means of shared random effects - MLwiN, Stata (Gllamm), SAS, AML;

• The estimation of non-identity link (and non nested CE) models, e.g. probit, can be computationally demanding;

Page 8: C Q e S S 1 E-Science, the GRID and Statistical Modelling in Social Research Rob Crouchley Collaboratory for Quantitative e-Social Science University of

10

C Q

e S

S Complication 2. Measurement Errors (ME)

• In observational studies, it is rarely possible to measure all relevant covariates accurately, e.g. age, educational attainment;

• Ignoring ME can seriously mislead the quantification of the link between explanatory and response variables;

• ME in one covariate can bias the association between other covariates and the response variable, even if those other covariates are measured without error;

Page 9: C Q e S S 1 E-Science, the GRID and Statistical Modelling in Social Research Rob Crouchley Collaboratory for Quantitative e-Social Science University of

11

C Q

e S

S Complication 2. Measurement Errors (ME)

• Also, some important determinants of behaviour are either not measured (i.e. omitted) or are unmeasurable (e.g. motivation);

• Repeated measures and longitudinal data provide the opportunity to deal with ME in explanatory variables, this adds to the computational demands of the analysis.

Page 10: C Q e S S 1 E-Science, the GRID and Statistical Modelling in Social Research Rob Crouchley Collaboratory for Quantitative e-Social Science University of

12

C Q

e S

SComplication 3.

Missing Data, Dropout and Selection• All of the major longitudinal data sets available to the British

social science community, (e.g. YCS, BHPS and NCDS), contain missing data and dropout;

• Ignoring this could create bias in the model estimated on the data;

• We need to model, as realistically as possible, the process by which the observed subjects have been retained in the sample, otherwise we will not know how much bias is present in our results;

• Also, some sample designs create selection effects of their own, e.g. by using a subset of locations, or oversampling the poor;

• These add to the computational demands of the analysis.

Page 11: C Q e S S 1 E-Science, the GRID and Statistical Modelling in Social Research Rob Crouchley Collaboratory for Quantitative e-Social Science University of

13

C Q

e S

SComplication 4.

Parametric Assumptions

• Our statistical tools are assumption rich:– Parametric linear predictors,– Parametric link functions and error structures;

• What if the assumed parametric relationships do not hold?

• BUT - Nonparametric statistical models are computationally intensive.

Page 12: C Q e S S 1 E-Science, the GRID and Statistical Modelling in Social Research Rob Crouchley Collaboratory for Quantitative e-Social Science University of

14

C Q

e S

SComplication 5.

Endogenous effects

• The curse of endogenous effects, everything seems to depend on everything else;

• We need multiprocess models (simultaneous equations) to disentangle this complexity, adds to computation;

Page 13: C Q e S S 1 E-Science, the GRID and Statistical Modelling in Social Research Rob Crouchley Collaboratory for Quantitative e-Social Science University of

16

C Q

e S

SDisentangling complexity

with existing tools: an exampleendogenous effects

• The YCS is a multi-stage stratified clustered random sample of individuals ages 16-17;

• I use YCS6 which covers young people eligible to leave school in 1990-91, who are then observed over the 1992-94 period.

Page 14: C Q e S S 1 E-Science, the GRID and Statistical Modelling in Social Research Rob Crouchley Collaboratory for Quantitative e-Social Science University of

17

C Q

e S

SPart-time work and truancy are potential determinants of educational attainment

A comprehensive model will allow us to disentangle the observable, direct, effects of truancy on educational attainment from any effects that arise from correlation in the errors (unobserved effects).

Page 15: C Q e S S 1 E-Science, the GRID and Statistical Modelling in Social Research Rob Crouchley Collaboratory for Quantitative e-Social Science University of

21

C Q

e S

STrivariate Ordered Probit Model

(Path Diagram)

ep Y*p

et Y *t

Yp

Yt

Yq Y*q eq

Independent Errors (ep, et, eq)

Educational

Attainment

Truancy

Part-time

work

Page 16: C Q e S S 1 E-Science, the GRID and Statistical Modelling in Social Research Rob Crouchley Collaboratory for Quantitative e-Social Science University of

22

C Q

e S

SIndependent Errors (ep, et, eq)

• This model is quick (1-2 seconds) to estimate, 3 linear predictors:

- Probit for PT work,

- Ordered Probits for Truancy and

Qualifications;

• We can use standard software, e.g. Stata.

Page 17: C Q e S S 1 E-Science, the GRID and Statistical Modelling in Social Research Rob Crouchley Collaboratory for Quantitative e-Social Science University of

23

C Q

e S

SCorrelated Errors

ep Y*p

et Y *t

Yp

Yt

Yq Y*q eq

Page 18: C Q e S S 1 E-Science, the GRID and Statistical Modelling in Social Research Rob Crouchley Collaboratory for Quantitative e-Social Science University of

25

C Q

e S

SProblems and Model Extensions

• Cant use standard software to fit the model via MLE;

• I used NAG software library, it has special routines to evaluate high dimensional multivariate normal integrals;

• Even so, this Model can take 2-3 weeks to estimate on a P4, 3 linear predictors, 169 parameters, 8,496 trivariate integrals for each function evaluation;

• Results from this model are quite different to those estimated under independence; e.g. one direct effect changes sign, another becomes NS;

Page 19: C Q e S S 1 E-Science, the GRID and Statistical Modelling in Social Research Rob Crouchley Collaboratory for Quantitative e-Social Science University of

26

C Q

e S

SWhat is happening?

• Evaluating lots of 3 dimensional integrals in order to compute our likelihood functions is computationally demanding;

• We could: Try other methods for evaluating integrals

such as Gibbs sampling and MCMC, Use approximations:

Laplace expansions with many termsPseudo and Quasi Likelihood Methods

Estimate fixed effects versions of the models; Use Instruments for the endogenous covariates

All can be computationally demanding, and each approach has its own problems;

Page 20: C Q e S S 1 E-Science, the GRID and Statistical Modelling in Social Research Rob Crouchley Collaboratory for Quantitative e-Social Science University of

27

C Q

e S

SIf we want to go this way, what can

we do?

• Use parallel algorithms on the Grid

• Use faster Hardware, e.g. HPCx, (also part of the Grid)

• Both

Page 21: C Q e S S 1 E-Science, the GRID and Statistical Modelling in Social Research Rob Crouchley Collaboratory for Quantitative e-Social Science University of

28

C Q

e S

SIn the education example I’ve assumed

• Particular directions for the direct effects• No Non Ignorable dropout in the YCS• No School Cluster effects present• MVN Error structure• Linear predictor, additive function• No measurement error in observed covariates

We do not yet have the computational power (on the GRID) to relax all the assumptions simultaneously in this model.

Page 22: C Q e S S 1 E-Science, the GRID and Statistical Modelling in Social Research Rob Crouchley Collaboratory for Quantitative e-Social Science University of

C Q

e S

SSABRE – Software for the Analysis of

Binary Recurrent Events

• What is it ?– Programme for analyising multivariate

binary, ordinal, count and recurrent events data. Employs fast numerical algorithms. Uses Gaussian Quadrature and NPMLE for the REs

• Some typical application areas.– Infertility in humans, animal husbandry.– Voting, trade union membership, economic

activity and migration.– Absenteeism studies.

Page 23: C Q e S S 1 E-Science, the GRID and Statistical Modelling in Social Research Rob Crouchley Collaboratory for Quantitative e-Social Science University of

31

C Q

e S

S

Page 24: C Q e S S 1 E-Science, the GRID and Statistical Modelling in Social Research Rob Crouchley Collaboratory for Quantitative e-Social Science University of

C Q

e S

SSABRE Why use it ?

Timing Comparisons(3.7 x106 observations 2 GB, 53 Variables)

1

10

100

1000

10000

100000

1000000

Stata Glamm Sabre-1

Sabre-2

Sabre-4

Sabre-8

Sabre-16

Minutes

Data is administrative records covering the duration in employment in the workforce of a major Australian state government to investigate the determinants of quits and separations amongst permanent and temporary workers. NP base line hazard, quadrature for the REs

>1 week

>6 months

Page 25: C Q e S S 1 E-Science, the GRID and Statistical Modelling in Social Research Rob Crouchley Collaboratory for Quantitative e-Social Science University of

33

C Q

e S

SAn Alternative: Stata/MP

Page 26: C Q e S S 1 E-Science, the GRID and Statistical Modelling in Social Research Rob Crouchley Collaboratory for Quantitative e-Social Science University of

34

C Q

e S

SWhat about SABRE and Stata/MP

• Stata/MP is 1.7 times faster on 2 processors• Stata/MP is 2.8 times faster on 4 processors • Stata/MP is 4 times faster on 8 processors • Sabre can have a bit faster speedup, but the big

difference is probably the base from which Stata/MP starts. Using the previous example on our HPC we could have (in minutes)

Processors 1 2 4 8

Sabre 62 32 16 9Stata/MP 10183 5990 3637 2546

Page 27: C Q e S S 1 E-Science, the GRID and Statistical Modelling in Social Research Rob Crouchley Collaboratory for Quantitative e-Social Science University of

35

C Q

e S

SExample Data Obs Vars Kb Stata gllamm Sabre(1) Sabre(2) Sabre(4) Sabre(8)L1 pefr 34 4 2 00" 29" 00" 00" 01" 01"L2 nls (wage) 18995 20 3859 03" 2hr 12' 27" 15" 08" 05"L3 growth 153 8 14 00" 1' 00" 00" 00" 01" 01"L4 nls (union) 18995 20 3859 2' 02" 30' 04" 05" 03" 02" 02"L5 schiz 1603 8 140 n/a* 2' 24" 00" 00" 01" 01"L6 drvisits 2227 10 242 39" 9' 07" 02" 02" 01" 01"L7 filled 390432 94 367556 59hr 52' 3 months+ 34' 38" 18' 51" 11' 03" 7' 01"

lapsed 390432 94 367556 67hr 31' 3 months+ 29' 41" 16' 20" 9' 45" 6' 21"L8 filled-lapsed 780864 261 2134413 n/a 3 years+ 54hr 29' 32hr 5 ' 18hr 49' 11hr 58'L9 union-wage 37990 25 9683 n/a unexpected failure 18' 21" 9' 13" 4' 41" 2' 26"

Key

unexpected failure: the gllamm manual not does rule this bivarite model out, but gllamm crashed just after startingtime+: indicates a lower CPU limit

n/a: Stata 9 can not estimate bivariate random effects models using quadrature n/a*: Stata 9 can not estimate random effects ordered response models using quadrature

An empirical analysis of vacancy duration using micro data from Lancashire Careers

Service over the period 1985–1992, NP base line hazard, quadrature for the REs

Page 28: C Q e S S 1 E-Science, the GRID and Statistical Modelling in Social Research Rob Crouchley Collaboratory for Quantitative e-Social Science University of

36

C Q

e S

SWhat have I said so far?

• That the estimation (via maximum likelihood) of some statistical models can be very computationally demanding and beyond what you can usefully do on your desktop.

Page 29: C Q e S S 1 E-Science, the GRID and Statistical Modelling in Social Research Rob Crouchley Collaboratory for Quantitative e-Social Science University of

37

C Q

e S

SWays of running Sabre on the GRID

1. Directly via the operating system, e.g. Globus

2. Via a Portal, e.g. Science Gateway3. Via a desktop application, like the tip of

an iceberg (I’m going to concentrate on this for the rest of the talk)

Page 30: C Q e S S 1 E-Science, the GRID and Statistical Modelling in Social Research Rob Crouchley Collaboratory for Quantitative e-Social Science University of

C Q

e S

SUsing the Grid Via a Desktop

Application• Separation of Client and Server Logic

• Why ?– Implementation of Service Logic may change to

allow for improved algorithms, models or scheduling policies and so on

– However, user interface stays the same!!

Page 31: C Q e S S 1 E-Science, the GRID and Statistical Modelling in Social Research Rob Crouchley Collaboratory for Quantitative e-Social Science University of

C Q

e S

SClient ClientClient Client

GROWL Server

AgentAgent Agent Agent

Services

First Tier

Second Tier

Third Tier

Configuration

Page 32: C Q e S S 1 E-Science, the GRID and Statistical Modelling in Social Research Rob Crouchley Collaboratory for Quantitative e-Social Science University of

43

C Q

e S

SExample:

Using Sabre on a GRID from Stata

• User gets a Stata plugin (unzip it in the users ado directory)

• This adds some items to the Stata menus

• And provides a series of dialogue boxes

Page 33: C Q e S S 1 E-Science, the GRID and Statistical Modelling in Social Research Rob Crouchley Collaboratory for Quantitative e-Social Science University of

44

C Q

e S

S

Page 34: C Q e S S 1 E-Science, the GRID and Statistical Modelling in Social Research Rob Crouchley Collaboratory for Quantitative e-Social Science University of

45

C Q

e S

S

Page 35: C Q e S S 1 E-Science, the GRID and Statistical Modelling in Social Research Rob Crouchley Collaboratory for Quantitative e-Social Science University of

46

C Q

e S

SGROWL SERVICES

• Could contain lots of other software, e.g. MCMC software on the Grid

• Could use lots of different systems, NGS, NWG, etc

Page 36: C Q e S S 1 E-Science, the GRID and Statistical Modelling in Social Research Rob Crouchley Collaboratory for Quantitative e-Social Science University of

C Q

e S

SIntegration

Page 37: C Q e S S 1 E-Science, the GRID and Statistical Modelling in Social Research Rob Crouchley Collaboratory for Quantitative e-Social Science University of

50

C Q

e S

SIntegration

Page 38: C Q e S S 1 E-Science, the GRID and Statistical Modelling in Social Research Rob Crouchley Collaboratory for Quantitative e-Social Science University of

C Q

e S

SIntegration

Page 39: C Q e S S 1 E-Science, the GRID and Statistical Modelling in Social Research Rob Crouchley Collaboratory for Quantitative e-Social Science University of

52

C Q

e S

SIntegration

Page 40: C Q e S S 1 E-Science, the GRID and Statistical Modelling in Social Research Rob Crouchley Collaboratory for Quantitative e-Social Science University of

53

C Q

e S

SAuthentication required for a Fit

Page 41: C Q e S S 1 E-Science, the GRID and Statistical Modelling in Social Research Rob Crouchley Collaboratory for Quantitative e-Social Science University of

C Q

e S

SSABRE – Availability and Support

• Web Site http://sabre.lancs.ac.uk– Full Command Documentation– Tutorials– Example Data– Publications

• Downloads– “SabreR” binary R packages including

documentation (end 06/2006) – “SabreStata” Stata plugin including

documentation (end 07/2006)– Sabre source code

Page 42: C Q e S S 1 E-Science, the GRID and Statistical Modelling in Social Research Rob Crouchley Collaboratory for Quantitative e-Social Science University of

55

C Q

e S

SWhat have I said in part 2

.

• There are beginning to be some tools that can make a lot more resources (Grid) available to you from within desktop applications.

Page 43: C Q e S S 1 E-Science, the GRID and Statistical Modelling in Social Research Rob Crouchley Collaboratory for Quantitative e-Social Science University of

C Q

e S

SCollaboratory

For

Quantitative

E-Social

Science

Collaboratory

For

Quantitative

E-Social

Science

Collaboratory

For

Quantitative

E-Social

Science

Collaboratory

For

Quantitative

E-Social

Science

SABRESABRE is a program specifically

designed for the analysis of binary, ordinal, count recurrent events as

are common in many surveys. SABRE’s dedicated soft-ware

ensures fast response times.

Application area’s

• Studies of voting behavior, trade union membership, economic activity and migration.

• Demographic surveys.

• Studies of infertility in humans.

• Animal husbandry. • Absenteeism studies. • Clustered sampling

schemes.

Sabre was originally developed by Lancaster University’s Centre for Applied Statistics, further development and use cases have been funded by the EPSRC, and ESRC as part of the NCeSS CQeSS node

Acknowledgements:

• Course material for the use of Sabre is currently being developed.

• It is planned to launch a Sabre/GROWL service on the North West Grid within the coming year. This will provide a utility based grid resource.

• Research into labour markets using Sabre/Growl. • SABRE will become available as a plug in for

STATA

Lancaster’s Statistical Software for e-Social Scientists

Software for the Analysis of Binary Recurrent Eventswww.sabre.lancs.ac.uk

SABRE + RAdding SABRE as a plug-in to R

allows Sabre commands to be processed from the R user

interface. Configuration of models and preparation of data is then undertaken using the extensive

functionality of R

SABRE+ R+GROWL

Using GROWL Components, SABRE commands invoked in R are executed in parallel on

the GRID, making SABRE an excellent e-Social Science tool.

R Commander

The familiar R interface is being maintained by using SABRE as a plug in

Timing Comparisons(3.7 x 106 observations 2 GB, 53 Variables)

110

1001000

10000

1000001000000

Stata Glamm Sabre-1 Sabre-2 Sabre-4 Sabre-8 Sabre-16

MinutesFuture developments

Grid Resources on Work Stations

GROWL employs a client/server architecture that hides the complexity of GRID middleware from the user. Client access to GROWL employs a secure (PKI/SSL) connection to a single port on the host system and clients are authenticated using the distinguished name extracted from their certificate. The use of a persistent server to access grid resources allows all of the service logic to be hosted by the server, making the client application, library or plugin extremely lightweight.

GridResourcesOn WorkstationLibrarywww.growl.org.uk

e-science.lancs.ac.uk/

cqess/

Page 44: C Q e S S 1 E-Science, the GRID and Statistical Modelling in Social Research Rob Crouchley Collaboratory for Quantitative e-Social Science University of

57

C Q

e S

SYou can watch a more detailed

presentation about Growl by Dan Grose at the NCeSS conference on line at

http://redress.lancs.ac.uk/Workshops/Presentations.html

Page 45: C Q e S S 1 E-Science, the GRID and Statistical Modelling in Social Research Rob Crouchley Collaboratory for Quantitative e-Social Science University of

58

C Q

e S

SVersion on my PC

• C:\2005-6 laptopfiloes\CQeSS\Oxford RMF\imp\dan_grose_large

• Any Questions ?