Skip to content

Instantly share code, notes, and snippets.

@fgregg
fgregg / inclass.R
Created February 17, 2015 20:13
Our running analysis of income gender inequality in Illinois.
pums <- read.csv("small_pums.csv")
hist(pums$WAGP)
male_income <- pums$WAGP[pums$SEX=="male"]
female_income <- pums$WAGP[pums$SEX=="female"]
plot(WAGP ~ SEX, data=pums)
summary(lm(WAGP ~ 1,data=pums))
geoid10 | cases | person_years
-----------------+-------+--------------
170318390004004 | 470 | 1265
170318374002019 | 174 | 535
170318419002089 | 219 | 530
170318368002005 | 118 | 513
170313814001005 | 18 | 463
170310313004006 | 129 | 392
170314909022041 | 44 | 358
170312315005016 | 30 | 311
@fgregg
fgregg / path_model.R
Created March 9, 2015 21:12
Path model with logistic regression.
pums <- read.csv("small_pums.csv")
pums$ESR <- factor(pums$ESR,
labels=c("civilian employed, at work",
"civilian employed, with a job but not at work",
"unemployed",
"armed forces, at work",
"not in labor force"))
pums$college <- factor(pums$SCHL > 17, labels=c("no college", "some college"))
@fgregg
fgregg / ctrl.md
Last active November 9, 2018 17:24
Civic Tech Reading List (CTRL)

#FG's list

Things I haven't read, but would like to

  • Tools for Conviviality
  • Some things about information systems within corporations, maybe something about Toyota and Walmart
  • Some things about modern public relations
  • Some things about the Rand Corporation
  • Some things about Herman Kahn and early Hudson Institute
  • http://www.culturemachine.net/index.php/cm/article/view/511/526
@fgregg
fgregg / foia_counts
Created May 4, 2015 00:44
Chicago FOIA counts
Buildings,https://data.cityofchicago.org/resource/ucsz-xe6d.json?$select=date_trunc_y(date_received)%20as%20year,COUNT(*)&$group=year&$order=year
Revenue,https://data.cityofchicago.org/resource/zrv6-shhf.json?$select=date_trunc_y(date_received)%20as%20year,COUNT(*)&$group=year&$order=year
311,https://data.cityofchicago.org/resource/j2p9-gdf5.json?$select=date_trunc_y(date_received)%20as%20year,COUNT(*)&$group=year&$order=year
Transportation,https://data.cityofchicago.org/resource/u9qt-tv7d.json?$select=date_trunc_y(date_received)%20as%20year,COUNT(*)&$group=year&$order=year
Law,https://data.cityofchicago.org/resource/44bx-ncpi.json?$select=date_trunc_y(date_received)%20as%20year,COUNT(*)&$group=year&$order=year

Query:

select 
  max(pin::bigint) as example, 
  count(*) num_properties, 
  ROUND(current_total/current_market_value::numeric, 2::int) as assessment_level 
from taxes 
where 
 current_market_value !=0 
@fgregg
fgregg / complaints.md
Created May 28, 2015 22:38
Complaint Types for Board of Review
  • A = ADD - review of assessment
  • E = EXEMPT - review of exempt status of parcel, because owned by tax exempt private entity
  • G = GOVERNMENT - review of exempt status of parcel, because owned by a government
  • P = PRE-FILE give data - a review of assessment where complainant has pre-filed evidence
  • T = TWO TOWNSHIPS - the property straddles two townships
  • C = C OF C - certificate of correction, the tax assessor has made an error and is requesting an adjustment to the assessement
  • X = PRORATED PIN - a property that the complainant did not include in their filing, but which the BOR believes is relevant to its judgement
  • U = UNDERVAL - a third party complains that a property owner is paying too little taxes
name address
foo bar
@fgregg
fgregg / stalled.csv
Created December 4, 2017 15:39
Majority sponsored, stalled bills
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
O 2017-6854
Or 2016-673
O 2017-6485
R 2017-734
O 2017-225
R 2017-726
O 2016-5666
O 2017-1018
R 2016-908
Or 2017-365