Giter VIP home page Giter VIP logo

qss's Introduction

QSS (Quantitative Social Science) Build Status

Supplementary Materials for the book, Quantitative Social Science: An Introduction, published by Princeton University Press in 2017. See the book website. It is also available for purchase at vendors like Amazon. Also included are materials for Quantitative Social Science: An Introduction in tidyverse, published by Princeton University Press in 2022. All tidyverse versions contain "-tidy" in their file names.

The book is based on the teaching philosophy summarized in the talk I gave at the Nuffield Foundation's Q-Step Programme in 2015: slides

This repository contains the data sets and R scripts (available in .R, .Rmd, and .pdf formats) for all of the chapters:

  1. Introduction
  2. Causality
  3. Measurement
  4. Prediction
  5. Discovery
  6. Probability
  7. Uncertainty

In addition, the repository contains:

  1. Errata (QSS, QSStidy)
  2. Sample course syllabi

R package qss

The data and code in this repository are also available as an R package qss (see the package website). The code is in the form of vignettes. To install this package, use the following command:

install.packages("devtools") # if you have not installed devtools package already
devtools::install_github("kosukeimai/qss-package", build_vignettes = TRUE)

Once the qss package is installed, you can use the data and vignette:

library(qss)
data(package = "qss") # list all data sets
data(elections) # load the elections data
vignette(package = "qss") # list all vignettes
browseVignettes("qss") # list vignettes and R code
vignette("causality", package = "qss") # show the vignette for the Causality chapter

Related repositories

  1. swirl exercises qss-swirl
  2. Interactive Tutorials for QSS by Matt Blackwell
  3. R package qss (the package website)
  4. tidyverse code qss-tidy by Jeff Arnold (the starting point for the QSS: tidyverse version of the book)
  5. R package qss.student for students by Will Lowe
  6. python code qsspy by Jeffrey Allen
  7. instructors' materials qss-inst
  8. Lecture slides for QSS

The last two repositories are private. Instructors who wish access to these materials should either request access at the book website or email me.

qss's People

Contributors

brandondelacuesta avatar ecohen13 avatar evancchow avatar hj08003 avatar jrnold avatar kosukeimai avatar masatakaharada avatar norawebbwilliams avatar ryantmoore avatar tedenamorado avatar tlevshin avatar tylersimko avatar winston-chou avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

qss's Issues

Issue installing QSS package

I have the following error when I install the packages - tried on all three links listed on the website but to no avail..

Is there a way to install without the 'uncertainty.Rmd' file which seems to be causing the problem? Any other fixes to get started would be greatly appreciated as I can't seem to find anything googling these errors.

Error: Failed to install 'qss' from GitHub:
System command 'R' failed, exit status: 1, stdout + stderr (last 10 lines):
E> --- finished re-building ‘probability.Rmd’
E>
E> --- re-building ‘uncertainty.Rmd’ using rmarkdown
E> --- finished re-building ‘uncertainty.Rmd’
E>
E> SUMMARY: processing the following file failed:
E> ‘discovery.Rmd’
E>
E> Error: Vignette re-building failed.
E> Execution halted

Text typo in sentence on critical value (sec 7.1.3)

Sec 7.1.3 and p.372 in the tidyverse version of QSS (also the non-tidyverse version) says

$z_{\alpha/2}$ is the critical value, which equals the $(1 − \alpha/2)$ quantile of the standard normal distribution such that $P(Z> \alpha/2) = 1 -P(Z \leq \alpha/2) = 1-\alpha/2$, where Z is a standard normal random variable."

I think the last part should be $=\alpha/2$ instead of 1 minus it? P(Z > z_{0.025}) = P(Z > 1.96) = 0.025.

The Federalist

Small thing: It's the Federalist Papers (not the Federal Papers)

error when trying to execute qss swirl modules

Some students are having difficulty getting qss to run, which I can reproduce on my machine:

> install_course_github("kosukeimai", "qss")
perl is deprecated. Please use regexp instead

This part seems to work, despite the deprecation message. Then

> swirl()

| Welcome to swirl!

| Please sign in. If you've been here before, use the same name as you did
| then. If you are new, call yourself something unique.

What shall I call you? bgoodri

| Please choose a course, or type 0 to exit swirl.

1: qss
2: Take me to the swirl course repository!

Selection: 1

| Please choose a lesson, or type 0 to return to course menu.

1: CAUSALITY
2: DISCOVERY
3: INTRO
4: LICENSE
5: MEASUREMENT
6: PREDICTION
7: PROBABILITY
8: README.md
9: UNCERTAINTY

Selection: 1

Error in file(con, "r") : invalid 'description' argument

| Leaving swirl now. Type swirl() to resume.

The traceback and session info is

> traceback(max.lines = 5)
15: file(con, "r")
14: readLines(input)
13: paste(readLines(input), collapse = "\n")
12: yaml.load(paste(readLines(input), collapse = "\n"), ...)
11: yaml.load_file(file)
10: parse_content.yaml(file, e)
9: parse_content.default(dataName, e)
8: parse_content(dataName, e)
7: loadLesson.default(e, courseU, lesson)
6: loadLesson(e, courseU, lesson)
5: mainMenu.default(e)
4: mainMenu(e)
3: resume.default(e, ...)
2: resume(e, ...)
1: (function (expr, val, ok, vis, data = e) 
   {
       e$expr <- expr
       e$val <- val
       e$ok <- ok
    ...
> sessionInfo()
R version 3.2.3 (2015-12-10)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Debian GNU/Linux stretch/sid

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
 [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] swirl_2.2.21

loaded via a namespace (and not attached):
 [1] httr_1.0.0      R6_2.1.1        magrittr_1.5    tools_3.2.3    
 [5] RCurl_1.95-4.7  curl_0.9.4      yaml_2.1.13     memoise_0.2.1  
 [9] crayon_1.3.1    stringi_1.0-1   stringr_1.0.0   digest_0.6.9   
[13] testthat_0.11.0 bitops_1.0-6   
> 

I will try to dig into the error more.

Repackage QSS data and code as an R package

It's a bit awkward to work with the csv's in their current form and to write reproducible code. Have you considered releasing an R package of the data instead or in addition to this? I quickly put together an R package with all the QSS data: https://github.com/jrnold/qss-data. All datasets as either built-in datasets to load, or files accessible through system.file, the scripts are included as demos for the package, and the package builds its own website using pkgdown. Right now the entire thing is scripted to build from the latest version of this repository. The only thing that is missing is metadata about variables.

Fix sectioning in Chapter 4?

In the 2022 tidyverse of QSS, section 4.3 is only a single paragraph. This paragraph is part of a larger section in the non-tidy original version. Maybe 4.4 should be a subsection, e.g.?

Different primary years used for social.csv in CAUSALITY and PREDICTION

In CAUSALITY/social.csv the primary year is 2006 in variable primary2006, while in PREDICTION/social.csv the primary year is 2008 in variable primary2008. Since these should both be the same data from

Alan S. Gerber, Donald P. Green, and Christopher W. Larimer. (2008). “Social Pressure and Voter > Turnout: Evidence from a Large-Scale Field Experiment.” American Political Science Review, Vol. > 102, No. 1, pp. 33–48.

the primary year should be 2006 in both. This also affects the code and text in Section 4.3 that refers to the 2008 primary and primary2008 variable.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.