Commit c8fd4ad8 authored by Ricco Førgaard's avatar Ricco Førgaard

Sanitazion, test data, and pom-fixing.

Sanitized Level 6.
Added test data for publishing.
Removed Surefire stuff from pom.xml. It doesn't seem to be necessary and
it just makes a lot of noise.
parent 6fb56f4f
......@@ -37,16 +37,6 @@
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.12.4</version>
<configuration>
<includes>
<include>**/Level*.java</include>
</includes>
</configuration>
</plugin>
</plugins>
</build>
</project>
......@@ -44,41 +44,58 @@ public class Level06 {
}
/**
* Create a slice using the dimensions Foo and Bar and
* then retrieve the value of the cell at Foo.c, Bar.z
* Create a slice using Region, Party and Year as dimensions and
* number of votes as measure.
*
* Then find out how many votes the Moderate Party (1) had in the entire
* country (SE) in 1994.
*
* Hint: The party dimension is at index 0, region is 1 and year is 2.
* The measure has index 0.
*/
public void getCellValuesFromSlice() {
double cellValue = Double.NaN;
@Test
public void getCellValueFromSlice() {
double value = Double.NaN;
assertEquals(123d, cellValue, 0d);
assertEquals(1243253d, value, 0d);
}
/**
* Create a slice using foo and bar as dimensions and baz
* as measure. Also add the members a and b from Foo and
* the members x, y, and z from Bar.
* Create a slice using the dimensions Year, Region, and Party.
* Find out how many percent invalid votes (13) there were in
* Sydsverige (SE22) in 2002.
*
* Then retrieve the value for Foo.a and Bar.y
* Hint: See the previous test for dimension indexes.
* The "% votes" measure has index 1.
*/
@Test
public void getSliceWithMembers() {
double value = Double.NaN;
public void getCellValuesFromSlice() {
double cellValue = Double.NaN;
assertEquals(123d, value, 0d);
assertEquals(1.33d, cellValue, 0.01d);
}
/**
* Create a slice using Foo and Bar as dimensions and
* Baz as Measure. For Foo you must also limit the slice
* to the members a, b, and c.
* Create a slice using the following dimensions and their members:
* - Party: Moderate Party (1), Centre Party (6), and Green Party (7).
* - Region: Stockholm (SE11)
* - Year: 2002, 2006, 2010
*
* Then traverse the slice and put all cells in the list.
* Then traverse the cells in the slice and put all cells in the list.
* Optionally, you can print the list to System.out if you like.
*
* Hint: To traverse the cells, traverse lists of the members you used as
* input and build coordinates for each combination.
*/
@Test
public void getListOfCells() {
public void limitByMembers() {
List<Cell> allCells = null;
assertEquals(20, allCells.size());
assertEquals(9, allCells.size());
assertEquals(5.46d, (double) allCells.get(4).getValue(), 0.01d);
}
// Bonus assignment: do the last test again but try to print the output
// as a table.
// Hint: you need to traverse the members of the dimensions' levels...
}
<?xml version='1.0' encoding='UTF-8'?>
<codeBook version="1.2.2" ID="demo_gor" xml-lang="en" xmlns="http://www.icpsr.umich.edu/DDI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.icpsr.umich.edu/DDI http://www.icpsr.umich.edu/DDI/Version1-2-2.xsd">
<docDscr>
<citation>
<titlStmt>
<titl>
Temp#37
</titl>
</titlStmt>
<prodStmt>
<prodDate date="2002-01-14">
2002-01-14
</prodDate>
<software version="4.0 Beta 24" date="2009-02-10">
Nesstar Publisher
</software>
</prodStmt>
</citation>
</docDscr>
<stdyDscr>
<citation>
<titlStmt>
<titl>
Demo: Demonstration dataset
</titl>
<IDNo>
demo_gor
</IDNo>
</titlStmt>
<rspStmt>
<AuthEnty affiliation="UK Data Archive">
Ward, M.
</AuthEnty>
<AuthEnty affiliation="UK Data Archive">
Eastaugh, K.
</AuthEnty>
</rspStmt>
<prodStmt>
<producer>
UK Data Archive
</producer>
<software version="4.0 Beta 24" date="2009-02-10">
Nesstar Publisher
</software>
<fundAg>
Economic and Social Research Council
</fundAg>
<fundAg>
University of Essex
</fundAg>
</prodStmt>
<distStmt>
<distrbtr abbr="UKDA" affiliation="University of Essex, Wivenhoe Park, Colchester, Essex, England, CO4 3SQ" URI="http://www.data-archive.ac.uk/">
UK Data Archive
</distrbtr>
<depDate date="1989-02-10"/>
</distStmt>
</citation>
<stdyInfo>
<subject>
<keyword>
AGE
</keyword>
<keyword>
BRITISH POLITICAL PARTIES
</keyword>
<keyword>
GENDER
</keyword>
<keyword>
HOUSING TENURE
</keyword>
<keyword>
MARITAL STATUS
</keyword>
<keyword>
NEWSPAPER READERSHIP
</keyword>
<keyword>
RELIGIOUS DENOMINATION
</keyword>
<keyword>
SCOTLAND
</keyword>
<topcClas>
British Election Studies
</topcClas>
<topcClas>
Election and campaign studies
</topcClas>
</subject>
<abstract>
<![CDATA[This dataset has been created specifically for demonstration purposes only.
Selected variables were taked from the BES 1987 dataset and other, dummy variables were created for specific purposes, e.g. to demonstrate the use of 'Time' variables and for mapping.]]>
</abstract>
<sumDscr>
<timePrd date="1987-01-01" event="single"/>
<nation>
Great Britain national
</nation>
<geogCover>
Great Britain
</geogCover>
<anlyUnit>
Individuals
</anlyUnit>
<universe>
Voters in Great Britain.
</universe>
</sumDscr>
</stdyInfo>
<method>
<dataColl>
<timeMeth>
Cross-sectional (one-time) study
</timeMeth>
<sampProc>
Nationally representative probability sample drawn from the Electoral Registers of England, Wales and Scotland (south of the Caledonian Canal).
</sampProc>
<collMode>
Face-to-face interview; Self -completion.
</collMode>
<sources/>
<weight>
The weighting variable is called WEIGHT. The data must be weighted to take account of regional differences in response rates.
</weight>
</dataColl>
</method>
<othrStdyMat>
<relStdy>
Group constituents: 359, 422, 666, 681, 830, 1533, 1614, 2005, 2568, 2981, 2983, 3171, 3887-3891, 4000, 4028
<citation>
<titlStmt>
<titl>
Group: 33066
</titl>
</titlStmt>
</citation>
</relStdy>
<relStdy>
<![CDATA[1591 Welsh Election Study, 1979
1604 Scottish Election Study, 1979
2655 British Election Campaign Study, 1987
2920 Study of The Labour Party Membership, December 1989 - May 1990
3175 British Elections, 1963-1992
3588 British Election Studies Information System (BESIS), 1964-1992
4180 Welsh Assembly Election Study, 1999
33099 Political Change in Britain, 1963-1970
]]>
<citation>
<titlStmt>
<titl>
Other Related:
</titl>
</titlStmt>
</citation>
</relStdy>
<relStdy>
<![CDATA[Constituent Datasets:
British Election Study, February 1974. Cross-Section Survey (SN:359)
British Election Study, 1969, June 1970, February 1974.
Panel Survey (SN:422)
British Election Study, October 1974. Cross-Section Survey (SN:666)
British Election Study, October 1974.
Scottish Cross-Section Sample (SN:681)
British Election Study: EEC Referendum Survey, 1975 (SN:830)
British Election Study, May 1979. Cross-Section Survey (SN:1533)
British Election Study, February 1974, October 1974, June 1975, May 1979. Panel Survey (SN:1614)
British General Election Study, 1983. Cross-Section Survey (SN:2005)
British General Election Study, 1987. Cross-Section Survey (SN:2568)
British General Election Study, 1992. Cross-Section Survey (SN:2981)
British General Election Panel Study, 1987-1992 (SN:2983)
General Election in Scotland, 1992 (SN:3171)
British General Election Study, 1997. Cross-Section Survey (SN:3887)
British Election Panel Study 1992-1997 (SN:3888)
Scottish Election Survey, 1997 (SN:3889)
British General Election Study, 1997 : Campaign Panel (SN:3890)
British General Election Study, 1997 : Ethnic Minority Survey (SN:3891)
British Election Panel Study, 1983, 1986 and 1987 (SN:4000)
British Election Panel Study, 1997-2001. Waves 1, 2, 3, 4 and 5 (1997-2000) (SN:4028)
]]>
<citation>
<titlStmt>
<titl>
Group 33099: Political Change in Britain, 1963-1970
</titl>
</titlStmt>
</citation>
</relStdy>
<relPubl>
<![CDATA[British Election Study, (1974) "The British Election Study panel sample 1974: methodological study", June.
British Election Study, (1974) "The British Election Survey: technical document", July.
Crewe, I., Sarlvik, B. and Alt, J., (1974) `The why and how of the February voting', "New Society", 12 September.
Crewe, I., Sarlvik, B. and Alt, J., (1974) "The flow of the vote 1970 February 1974 - October 1974".
Sarlvik, B., Crewe, I. and Alt, J., (1974) "Class and Party in the elections of 1974".
Crewe, I., Sarlvik, B. and Alt, J., "The decline of the two-party system", paper presented to Political Studies Association Conference, Oxford, March 1975.
British Election Study, (1975) "The British Election Study of October 1974: methodological report", April.
British Election Study, (1975) "The British Referendum Survey: a report on fieldwork for the Referendum Recall Study", August.
Fox, A., (1975) `Attitudes to immigration: a comparison of data from the 1970 and 1974 general election surveys', "New Community" Vol. IV (2), Summer.
Miller, W., (1975) Series of articles on the special Scottish surveys, "The Scotsman", October 10 and 12.
Sarlvik, B., et al, (1976) `Britain's membership of the EEC: a profile of electoral opinions in the spring of 1974 - with a postscript on the referendum', "European Journal of Political Science" Vol. 4 (1), March, pp.83-113.
Fox, A. and Alt, J., "The reliability of occupational coding", paper presented to SSRC Seminar on Longitudinal Studies, Cambridge, March 1976.
Crewe, I., Sarlvik, B. and Alt, J., "The erosion of partisanship 1964 - 1975", paper presented to the Political Studies Association Conference, Nottingham, March 1976.
Alt, J., "Personal well-being and economic trends in Britain", paper presented to ECPR Workshop on Protest, Dissatisfaction and Change, ECPR Joint Sessions, Louvain-la-Neuve, April 1976.
Alt, J., Sarlvik, B. and Crewe, I., (1976) `Partisanship and policy choice: issue preferences in the British electorate, February 1974', "British Journal of Political Science", 6(3), July.
Alt, J., Sarlvik, B. and Crewe, I., (1976) `Individual differences scaling and group attitude structures', "Quantity and Quality", Vol.10, December.
Crewe, I., Sarlvik, B. and Alt, J., (1976) `The election of February 1974' IN R. Rose (ed.), "Studies in British Politics", 3rd edition, London: Macmillan.
Crewe, I., Fox, A. and Alt, J., (1977) `Non-voting in British general elections 1966 - October 1974' IN C. Crouch (ed.), "British Political Sociology Yearbook: Vol. III,
Political Participation", London: Croom Helm.
Miller, W., (1977) `The connection between SNP voting and the demand for Scottish self government', "The European Journal of Political Research", 5(1), March.
Crewe, I., Sarlvik, B. and Alt, J., (1977) `Partisan dealignment in Britain 1964 - 1974', "British Journal of Political Science", 7(2), April.
Alt, J., Crewe, I. and Sarlvik, B., (1977) `Angels in plastic: Liberal support in 1974', "Political Studies", 25(3), September.
Crewe, I. and Sarlvik, B., (1979) `The Conservative Party and the electorate', IN T.L. Henry (ed.), "Conservative Party politics", London: Macmillan.
Alt, J.E., (1979) "The politics of economic decline", Cambridge University Press.
Crewe, I.M. and Sarlvik, B., (1979) `Popular attitudes and electoral strategy' IN Z. Layton-Henry (ed.), "Conservative Party politics", London: Macmillan.
Crewe, I.M., (1980) `Why the Conservatives Won', in H. Penniman (ed.), "Britain at the Polls", American Enterprise Institute.
Crewe, I.M., "Negative partisanship: some preliminary ideas using British data", Paper presented to European Consortium for Political Research, Florence, March, 1980.
Crewe, I.M., (1980) `Prospects for party realignment: an Anglo-American comparison' "Comparative Politics", 12(4), July.
Crewe, I.M., "The electoral decline of the Labour Party", paper presented to Conference on the Politics of the Labour Party, Nuffield College, Oxford, September 1980.
British Election Study, (1980) "A comparison of respondent's characteristics with known population parameters", Technical paper 1980:1.
British Election Study, (1980) "The British Election Study, May 1979 questionnaire", Technical paper 1980:2.
British Election Study, (1981) "A description of surveys conducted by the BES Research Project", Technical paper 1981:1.
British Election Study, (1981) "Questionnaire continuity guide", Technical paper 1981:2.
Crewe, I.M., (1981) `The Labour Party and the electorate', in D.A. Kavanagh (ed.), "The politics of the Labour Party", London: Allen Unwin.
Sarlvik, B., Crewe, I.M., and Robertson, D., "Why the parties were liked and disliked in the 1979 Election: an analysis of `Free Answer' survey data", paper presented to the Political Studies Association Conference, Hull, April 1981.
Crewe, I.M., "Electoral Volatility in Britain Since 1945", paper presented to the European Consortium for Political Research, Lancaster, 1981.
Crewe, I.M., "Party and the public", paper presented to the Hansard Society/American Enterprise Institute Conference on the Role of Political Parties, Ditchley Park, Oxfordshire, May 1981.
Heath, A.F. and MacDonald, S-K., (1988) `The demise of party identification theory?' "Electoral Studies", 7, pp.95-107.
Swaddle, K. and Heath, A. (1987) "Official and reported turnout in the British General Election of 1987", Nuffield College, University of Oxford.
Heath, A., (1991) "Understanding political change : voting behaviour in Britain 1964-1987", Oxford: Pergamon.
Heath, A.F. and Pierce, R. (1992) 'It was party identification all along : question-order effects on reports of party identification in Britain' "Electoral Studies", II.
Heath, A., et al, (eds.) (1993) "Labour's last chance : the 1992 election and beyond", Aldershot: Dartmouth.
Heath, A., Jowell, R. and Curtice, J. (2001) "The rise of New Labour: party policies and voter choices", Oxford: Oxford University Press.
Brook, L. and Taylor, B. (1996) "British Election Panel Study 1992-95: Interim technical notes", CREST Working Paper 41.
Taylor, B., Heath, A. and Lynn, P. (1996) "The British Election Panel Study 1992-95: Response characteristics and attrition", CREST Working Paper 40.
Surridge, P. et al, (1998) `The Scottish electorate and the Scottish parliament' "Scottish Affairs" special issue.
Saggar, S. (ed.) (1998) "Race and British electoral politics", London: UCL Press.
Thomson, K., Park, A. and Brook, L. (1999) "British General Election Study 1997: Cross-section Survey, Scottish Election Study, and Ethnic Minority Election Study", London: National Centre for Social Research.
]]>
<citation>
<titlStmt>
<titl>
By Principal Investigator:
</titl>
</titlStmt>
</citation>
</relPubl>
<relPubl>
<![CDATA[Taylor-Gooby, P. (1987) `Welfare attitudes : cleavage, consensus and citizenship' "The Quarterly Journal of Social Affairs", 3(3), pp.199-211.
Rabinowitz, G., Macdonald, S.E. and Listhaug, O., "Competing theories of issue voting : is discounting the explanation?", paper prepared for delivery at the Annual Meeting of American Political Science Association, Washington DC, September 2-5 1993.
Baker, J.R. et.al., "Looking at Legislatures : citizens' knowledge and perceptions of legislatures in Canada, Great Britain and the United States", paper prepared for delivery at the 16th International Congress of the International Political Science Association (RC8:2), Berlin, August 21-25 1994.
Baker, J.E. et al (1996) `Citizens' knowledge and perceptions of legislatures in Canada, Britain and the United States' "The Journal of Legislative Studies", 2(2), pp.44-62.
Kobori, M. (1996) `A study on the North-South divide in Britain of 80s : with reference to the difference of Labour's votes between the North and South' "Ryudai Law Review", 56, May, pp.72-104.
Bennett, S., Flickinger, R., and Rhine, S. "Political talk - over here, over there and over time : a comparative analysis of who talks about politics in Britain and the United States, 1959-1994", paper presented to the International Society of Political Psychology meeting, Vancouver, June 30th-July 3rd 1996.
Evans, G. and Norris, P. (1999) "Critical elections: British parties and voters in long-term perspective", London: Sage Publications.
Tunstall, H. et al (2000) 'Geographical scale, the 'feel-good factor' and voting at the 1997 general election in England and Wales' "Transactions of the Institute of British Geographers", 25, p.51-64.
Dardanelli, P. (2001) "The Europeanisation of regionalisation: European integration and public support for self-government in Scotland 1979/1997", Queen's Papers on Europeanisation, No. 5/2001, London School of Economics.
]]>
<citation>
<titlStmt>
<titl>
By Others:
</titl>
</titlStmt>
</citation>
</relPubl>
</othrStdyMat>
</stdyDscr>
<fileDscr URI="Temp#37.~esstar?Index=0&amp;Name=demo_gor">
<fileTxt>
<fileName ID="F1">
demo_gor.NSDstat
</fileName>
<fileCont>
British Election Study 1987
</fileCont>
<dimensns>
<caseQnty>
500
</caseQnty>
<varQnty>
20
</varQnty>
</dimensns>
<fileType>
Nesstar 200801
</fileType>
</fileTxt>
</fileDscr>
<dataDscr>
<varGrp ID="VG1" type="subject" var="V1 V2">
<labl>
Admin
</labl>
</varGrp>
<varGrp ID="VG4" type="subject" var="V8 V9 V10 V11 V12 V13 V14 V15">
<labl>
Classification
</labl>
</varGrp>
<varGrp ID="VG3" type="subject" var="V4 V5 V6 V7">
<labl>
Political interest
</labl>
</varGrp>
<varGrp ID="VG6" type="subject" var="V16">
<labl>
Spatial information
</labl>
</varGrp>
<varGrp ID="VG5" type="subject" var="V19 V17 V18">
<labl>
Travel &amp; Time
</labl>
</varGrp>
<varGrp ID="VG2" type="subject" var="V3">
<labl>
Weights
</labl>
</varGrp>
<varGrp ID="VG7" type="subject" var="V20">
<labl>
Misc.
</labl>
</varGrp>
<var ID="V1" name="SERIALNO" files="F1" dcml="0" intrvl="contin">
<location width="4" RecSegNo="1"/>
<labl>
Serial number
</labl>
<valrng>
<range UNITS="REAL" min="1" max="6000"/>
</valrng>
<sumStat type="vald">
500
</sumStat>
<sumStat type="invd">
0
</sumStat>
<sumStat type="min">
1
</sumStat>
<sumStat type="max">
711
</sumStat>
<sumStat type="mean">
339.81
</sumStat>
<sumStat type="stdev">
210.377
</sumStat>
<varFormat type="numeric" schema="other"/>
</var>
<var ID="V2" name="BATCH" files="F1" dcml="0" intrvl="contin">
<location width="3" RecSegNo="1"/>
<labl>
Batch number
</labl>
<valrng>
<range UNITS="REAL" min="1" max="384"/>
</valrng>
<sumStat type="vald">
500
</sumStat>
<sumStat type="invd">
0
</sumStat>
<sumStat type="min">
17
</sumStat>
<sumStat type="max">
368
</sumStat>
<sumStat type="mean">
175.916
</sumStat>
<sumStat type="stdev">
104.828
</sumStat>
<varFormat type="numeric" schema="other"/>
</var>
<var ID="V3" name="WEIGHT" wgt="wgt" files="F1" dcml="3" intrvl="contin">
<location width="5" RecSegNo="1"/>
<labl>
Weighting variable
</labl>
<valrng>
<range UNITS="REAL" min="0.85" max="1.189"/>
</valrng>
<sumStat type="vald">
500
</sumStat>
<sumStat type="invd">
0
</sumStat>
<sumStat type="min">
0.85
</sumStat>
<sumStat type="max">
1.025
</sumStat>
<sumStat type="mean">
0.937
</sumStat>
<sumStat type="stdev">
0.0876
</sumStat>
<varFormat type="numeric" schema="other"/>
<notes>
Weight to account for regional differences in response rates.
</notes>
</var>
<var ID="V4" name="V1" files="F1" dcml="0" intrvl="discrete">
<location width="1" RecSegNo="1"/>
<labl>
Cared which party won the general election
</labl>
<qstn>
<qstnLit>
Would you say you cared a good deal which Party won the recent General election or that you didn't care very much which Party won?
</qstnLit>
</qstn>
<valrng>
<range UNITS="REAL" min="1" max="9"/>
</valrng>
<universe clusion="I">
ASK ALL
</universe>
<TotlResp>
Summation of listed categories: 6000
</TotlResp>
<sumStat type="vald">
500
</sumStat>
<sumStat type="invd">
0
</sumStat>
<catgry>
<catValu>
1
</catValu>
<labl>
CARED A GOOD DEAL
</labl>
<catStat type="freq">
388
</catStat>
</catgry>
<catgry>
<catValu>
2
</catValu>
<labl>
DIDNT CARE VERY MUCH
</labl>
<catStat type="freq">
112
</catStat>
</catgry>
<catgry>
<catValu>
9
</catValu>
<labl>
NOT ANSWERED
</labl>
<catStat type="freq">
0
</catStat>
</catgry>
<varFormat type="numeric" schema="other"/>
</var>
<var ID="V5" name="V2A" files="F1" dcml="0" intrvl="discrete">
<location width="1" RecSegNo="1"/>
<labl>
Watch/listen to media broadcasts
</labl>
<qstn>
<qstnLit>
"During the election campaign, did you watch or listen to any Party election broadcasts on television or radio?"
</qstnLit>
</qstn>
<valrng>
<range UNITS="REAL" min="1" max="9"/>
</valrng>
<universe clusion="I">
ASK ALL
</universe>
<TotlResp>
Summation of listed categories: 6000
</TotlResp>
<sumStat type="vald">
500
</sumStat>
<sumStat type="invd">
0
</sumStat>
<catgry>
<catValu>
1
</catValu>
<labl>
YES
</labl>
<catStat type="freq">
405
</catStat>
</catgry>
<catgry>
<catValu>
2
</catValu>
<labl>
NO
</labl>
<catStat type="freq">
95
</catStat>
</catgry>
<catgry>
<catValu>
9
</catValu>
<labl>
NOT ANSWERED
</labl>
<catStat type="freq">
0
</catStat>
</catgry>
<varFormat type="numeric" schema="other"/>
</var>
<var ID="V6" name="V2B" files="F1" dcml="0" intrvl="discrete">
<location width="1" RecSegNo="1"/>
<labl>
Read newspaper articles about election
</labl>
<qstn>
<qstnLit>
"During the election campaign, did you read any newspaper articles about the election campaign?"
</qstnLit>
</qstn>
<valrng>
<range UNITS="REAL" min="1" max="9"/>
</valrng>
<universe clusion="I">
ASK ALL
</universe>
<TotlResp>
Summation of listed categories: 6000
</TotlResp>
<sumStat type="vald">
500
</sumStat>
<sumStat type="invd">
0
</sumStat>
<catgry>
<catValu>
1
</catValu>
<labl>