POLS 418/GEOG 418: Quantitative Methods
Associate Professor David C. Earnest
May 15, 2017
Problem Set #1
Instructions: Please answer each question below. You should type your problem set, and
you may either turn in a hard copy to me, or you may
Quantitative Methods- Study Guide- Reviewing Weights
Review Weights
Weights are used in the two survey datasets that are packaged with
the Pollock R_Companion workspace.
The General Social Survey gss
And National Election Study nes
They adjust for oversam
Quantitative Methods- Study Guide- Univariate Data
Describing Univariate Data in R
Review Descriptive statistics Review R commands
Extreme values game in R
Transforming variables in R
Exercise
Preview
Mean, Median and Mode
MeanMedian
Mode
Nominal data
Ord
Quantitative Methods- Study Guide- Types of Skewness
Types of skewness
Positive or right
Mean is above the median
Graphically to the right
Negative or left
Mean is below the median
Graphically to the left
Median is resistant to skewness
Median versus Mean
Quantitative Methods- Study Guide- parsing the Syntax
Parsing the syntax:
describe () is a function for descriptive statistics
nes is the name of the dataset
$ links the dataset and variable names.
age is the name of the variable weights= weights the obse
Quantitative Methods- Study Guide- Dispersion
Dispersion
What we need is some way to differentiate between data set #1 and
data set #2 to measure the degree of heterogeneity versus homogeneity.
Measures of dispersion indicate how the other values vary aro
Quantitative Methods- Study Guide- R Notes
R Notes
R will only display cumulative frequencies if your variable is classified
as an ordered factor.
class(dataset$variablename) #checks variable type
Heres an example of a command to change a variable into an
Quantitative Methods- Study Guide- Standard Deviation
Lets find a standard deviation in
R
Using the SDMTools package we loaded earlier we can simply use
this syntax:
wt.sd(x, wt)
Finding Standard Deviation Using R
Weighted:
wt.sd(dataset$variable,dataset$
Quantitative Methods- Study Guide- Tabular and Graphical Presentation
Tabular and Graphical Presentation
Review: Using R to calculate descriptive statistics.
The Value of Pictures and Tables in Data Description:
Using bar, histogram, and pie charts to vis
Quantitative Methods- Study Guide- Interval Data
Interval Data
Histograms
Group several values together in bins.
Creating a Histogram in R
wtd.hist(dataset$variable,dataset$optional.weight)
Histogram versus Bar Chart
Histogram Bar Chart
Interval Data
F
Quantitative Methods- Study Guide- Voting
VOTE FOR CLINTON, BUSH, PEROT
Frequency
Valid Percent
Cumulative Percent
Valid Bush
Perot
Clinton
Total 661
278
908
1847 35.8 15.1 49.2 100.0
35.8 15.1 49.2 100.0
35.8 50.8 100.0
Compute a frequency table for the
Quantitative Methods- Study Guide- Describing Univariate Data
Review of measurement
Describing central tendency
Describing dispersion
Homogeneity vs. Heterogeneity
Skewness
Using R Preview
Review - Using R
Download and install R, download R_companion work