• More Quick Updates

    1. Sorry. Another list post.

    2. WE DID THE TAXES BEFORE THEY WERE DUE. Ended up owing over three thousand bucks, though. Note that I did not even need to actually threaten that I was not going to renew the HBO subscription until the taxes were done.

    3. Now I need to renew the HBO subscription. Yes, yes I did look up the dates for Season 8 just to see if I could save fifteen bucks by waiting to sign up a month before the last episode so that we could watch all six episodes during one month. But then I was like, “eff it, I just spent three grand on putting kids in cages and whatever other nonsense things my federal government does. I should indulge myself in a TWO MONTH subscription to HBO so that I can see all the episodes on the same day as everyone else.”

    4. Secretly, I am pretending that the three grand (ok, more like $3500, but we are getting money back from the state) (plus the many other thousands of dollars that we had withheld from our paychecks) is going to the Department of Commerce and the Census API. Maybe some of it to the FAA.

    5. Cover letter update: Someone sent in an application with an eight-word cover letter. This “cover letter” was not actually a complete sentence. I moved the application on to the next step anyway, as an eight-word cover letter is still an existing cover letter.

    6. Both cats get to go to the veterinarian on Saturday! Woo! I already got the cat carriers out because the stupid cat hides under the couch when I first get the cat carrier out. But after it has been sitting around the living room for a few days, she will start to sleep in it.


  • Quick Updates

    1. Got an MRI of my head on Saturday. Got the results this morning: Nothing of note.

    2. The claim from the imaging center is that they do MRIs on weekends as a covenience to patients. I suspect it is because the machine brings in a lot of money. Sort of like how airlines try really hard to have all their planes in the air as much as possible.

    3. Although I was kind of suprised that a radiologist had time to read the MRI over the weekend. Since the imaging center is affiliated with a hospital chain, maybe the radiologists at the hospital read these MRIs when things are quiet at the hospital? As this is a different hospital system from the one where one of my former students is a radiology resident, I don’t know anyone who I can ask.

    4. Finally wised up on the third attempt to start my knitting project and put a lifeline at a key transition point. Not even two rounds past the lifeline, it looks like I am going to need it. How many times can this yarn tolerate being ripped out and reknitted? WE SHALL SEE.

    5. Also this weekend, looked through the Michelle Memorial Archives as part of an effort to show someone I know how actually and totally crazy they are. Also half-heartedly considering a book (the word “book” being construed very loosely) about the contents of the Michelle Memorial Archives.

    6. While looking at a publication in which Michelle published an essay, I discovered that a bead crocheter that I know also published an essay in that issue.

    7. Had dinner with a relative on Sunday.

    8. Work today has been a mix of catching up on all the things that came in over the weekend and trying to decide how hard to try to do something that one of my colleagues muses might be impossible. You see, there are two databases, and they have related data in similar forms, but they are not the same. Is there a way to make the reporting from one database match with the interface provided from the other database? Currently unclear.


  • Starting a Conspiracy Theory

    As a resident of our new, post-truth universe, I would like to start a totally untrue rumor/conpiracy theory.

    I am going to assert that Andrew Yang does not exist.

    As you might recall, I am from Schenectady. Andrew Yang is allegedly from Schenectady. No one I know knows this Andrew Yang. (We know a different Andrew Yang who is maybe three years older than the one who is running for president.) Specifically, my brother does not know Andrew Yang despite being from the same hometown, roughly one grade apart, and going to the same college.

    And, yes, Andrew Yang went to prep school. But other people who I know went to the same prep school! And they do not know him, either! No one remembers him from middle school!

    This would be the most amazing conspiracy theory in the whole world if Roxane Gay (who also went to that prep school and is also roughly the same age as me, my brother, and this alleged “Andrew Yang” character) had no recollection of him either.

    Part of me sort of hopes that my conspiracy theory is true. I’ve had enough of some of the real people running for president. An imaginary candidate might be a good break from reality.


  • The Gaping Maw of Content

    We have brought this upon ourselves at work: Not only do we provide all of our usual educational content, but we now also have a digital media thing going on. There is a podcast (which, like all podcasts, wants everyone to rate and review!). There is what is being called an online magazine, but which I think of as a company blog.

    Now that we have these things, they need to be fed and cared for. And since they are official publications, they need to stick to the official branding guidelines. I was asked if I wanted to write something for the online magazine. I do not. My writing interests have only a minimal intersection with the goals of this publication. And someone else already wrote about knitting.

    My one contribution was to make life a little bit more difficult for the staff setting this whole thing up. I pointed out that .news is a top level domain and that we should buy the .news domain corresponding to this product and point it at the online magazine.

    Plus, I already have two blogs that I can barely keep up with. (The other one is very pretend and mostly short comments about Pokémon Go.)


  • Getting Data from the Census API (with R)

    The census has a lot of data. Probably the biggest issue that I have with using census data is that there is so darn much of it. Also you can get it in a heck of a lot of ways.

    This particular story is going to be about the five year American Community Survey data because that is reported down to the “block group” level and has information about an enormous number of variables. If you don’t know what a block group is, you can think of it as a collection of roughly 1000 people who all live near each other. A block group is a subset of a census tract.

    First off, maybe you don’t want to use the API. Maybe your data are so precious that you don’t want to risk having them logged on some server in the Department of Commerce. In that case, you probably want to download a CSV from the Amerian FactFinder Download Center. The Download Center is really nice! And it has a lot of information organized by ZIP Code Tabulation Area (ZCTA), which is the Census’s answer to the ZIP code. If you already have street addresses with ZIP codes in your precious data set, you don’t even need to geocode anything. You will, however, still need to deal with the the fact that there are a heck of a lot of variables and they all have names like HC03_VC54. Definitely get any metadata that the Census offers you alongside your data.

    And what if your data are not precious and you want to use the API? Well, R is my tool of choice, so I’m going to tell you about how this works with R, but you can easily adapt this to your tool of choice as well. Long story short: you construct a URL that passes the variables of interest, and the Census will send back the information that you asked for.

    Since I’m talking about Census data, I’m thinking about questions of the form, “Tell me about this feature relating to the people in this location.” So I need to specify a location and a feature. The location can be a state, a county, a census tract, a block group, or one of several other less-well-known political boundaries. The feature can be something as straightforward as the total number of people who live in the location or it can be something pretty complicated, like the number of people of a certain combination of race, ethnicity, and age who rely on a specific mode of transportation to commute to work. You’ll find the names of the variables in the first column of this table. For example, B00001_001E tells you the unweighted sample count of the population in the location.

    So now that we know how to specify a variable, we need to also know how to specify a location. A block group is formed by combining the two-digit state code, the three-digit county code, the six-digit census tract code, and the one-digit block group code. Where do we get these codes?

    We can use the Census Geocoder API!

    In my example, I am going to feed in a latitude/longitude pair; the census geocoder can also work with street addresses.

    Here’s the sample code, which should be pretty self-explanatory.

    library(stringr)
    library(jsonlite)
    
    latitude <- "43.1010304"
    longitude <- "-75.2919624"
    
    geo_url <- str_c("https://geocoding.geo.census.gov/geocoder/geographies/coordinates?x=", longitude,"&y=", latitude, "&benchmark=Public_AR_Current&vintage=Current_Current&layer=10&format=json")
    
    geo_info <- fromJSON(geo_url)
    
    block_group <- geo_info[["result"]][["geographies"]][[1]][["BLKGRP"]]
    state <- geo_info[["result"]][["geographies"]][[1]][["STATE"]]
    county <- geo_info[["result"]][["geographies"]][[1]][["COUNTY"]]
    tract <- geo_info[["result"]][["geographies"]][[1]][["TRACT"]]
    

    I plugged the latitude and longitude in for the correct variables in the URL, sent the request, parsed the JSON, and then extracted the information. If you read through the raw response, you can learn that this location is in Oneida County, NY.

    Next I can ask the Census for the total number of people who live in this block group. For this I will need an API key (do note that you can geocode without an API key in case you were wondering where to find some free geocoding). It is not hard to request an API key.

    Adding to the code from above:

    census_api_key <- "your_key_goes_here"
    
    variable <- "B00001_001E"
    
    query_url = str_c("https://api.census.gov/data/2017/acs/acs5?get=", variable, ",NAME&for=block%20group:", block_group, "&in=state:", state, "%20county:", county, "%20tract:", tract, "&key=", census_api_key)
    
    my_data <- fromJSON(query_url)
    

    And then the my_data variable will hold the result of the call; the important part of the payload is in my_data[2, 1].

    There are R packages that will take care of assembling the URLs and extracting the data for you, but so far I have not found any tool that makes it easier to figure out the name of the variables that report the information that I care about. Watch out that you do not get sucked into an afternoon of sharing with everyone within earshot the median ages of people from various income groups who live in your neighborhood and who bicycle to work.


  • Unknitting

    I had forgotten to account for the fact that cotton doesn’t stretch as much as wool does as well as my absurd affection for size 0 needles, so I had to rip this all the way back to the beginning and rewind the yarn.

    If anyone asks, I am telling him that it is a sock. Because I don’t want to hear his snarky comments about the fact that I am making legwarmers.

    Knitting project


  • Putting Children to Work

    One of my scripts alerted me to a new user on our forums whose email address belongs to a domain where the MX record is set up incorrectly. Although, since the user was able to complete the registration process, this domain apparently can receive email.

    I checked out the domain. It belongs to a consulting company that provides services to small businesses.

    This new user’s first post on our message board was the sort of messy real-life application of algebra that I saw a lot of when I was spending too much of my time hanging out in the College of Business Administration.

    Do we think that this individual works for a consulting company while attending B-school and is looking for help on homework? Or that this person can’t figure out how to use fairly standard techniques in algebra to solve a client’s problem?


subscribe via RSS