Search Results: "Chris Lawrence"

20 May 2012

Chris Lawrence: cnlmisc 0.2 for R

The oft-promised update of the cnlmisc package for R is now posted. New in this release is a convenience method, sepplot, that produces separation plots using the separationplot package; this method works directly on model fit objects as a post-estimation call, and works with both binary and ordinal models at present. In addition, epcp now works with clm2 objects from the ordinal package. Most of this was motivated by continued work on the economic voting paper, which has also been updated. cnlmisc still has a long way to go before I submit it to CRAN, but at least it s progress, right?

12 April 2010

Chris Lawrence: epcp for R

I finally have packaged up a very rough port of my epcp routine from Stata to R as part of a package unimaginatively called cnlmisc; you can download it here. In addition to the diagnostics that the Stata routine provides, the glm method includes a bunch of R-square-like measures from various sources (including Greene and Long). The only part I m sure works at the moment is the epcp for glm objects (including survey s and Zelig s wrappers thereof); the others that are coded (for polr and VGAM) are probably half-working or totally broken, and some wrappers aren t there yet at all. The error bounds suggested by Herron aren t there either. The print routines need a lot of work too; eventually it will have a nice toLatex() wrapper as well. But it beats having it sit on my hard drive gathering dust; plus I may eventually get motivated to write a JSS piece or something based on it. epcp for Stata is still available at my site. For more information on the measure, see Michael C. Herron (1999), Postestimation Uncertainty in Limited Dependent Variable Models Political Analysis 8(1): 83 98 or Moshe Ben-Akiva and Steven Lerman (1985), Discrete Choice Analysis, MIT Press.

8 January 2010

Chris Lawrence: From the department of bad statistics

I m glad to see that some things never change; in this case, it s the low quality of local news reporting in Laredo. Pro8News breathlessly reports that Mexican drivers are less likely to be ticketed since less than 25% of parking tickets in Laredo are issued to Mexican-licensed vehicles. This story just begs to be placed on a research methods final as one of those identify all of the problems with this analysis questions. Bonus points for invoking Bayes theorem.

2 April 2009

Chris Lawrence: Posterized

The bits of paper I m hanging on the wall tomorrow (well, later today) at Midwest wherein I discuss Geographic Data Visualization Using Open-Source Data and R are now online here for the curious or insomnia-stricken.

20 March 2009

Chris Lawrence: How not to do data analysis

io9 presents a chart that purports to show that shark-jumping has an effect on television ratings. I ll freely concede that Battlestar Galactica has had its, er, weaker moments, but the chart doesn t actually show that creatively weak episodes had any effect whatsoever on the ratings that can be distinguished from the underlying, secular downward trend in ratings. Since I had about 300 more important things to do, I decided to analyze the data myself. First, I reentered the ratings data from here into an OpenOffice.org spreadsheet and then identified the shark-jump episodes with a dummy variable, with the help of IMDB. I then created two new variables: a simple ratings difference variable for each episode, and a dummy variable to indicate whether or not an episode immediately followed an identified shark-jump. I then converted to a CSV file, opened R, and estimated a linear regression: Delta = a + b(FollowShark). While the effect of an episode following a shark-jump was negative (about 0.025 ratings points), the effect was not statistically significant (p 0.736, two-tailed). Throwing out Razor and The Passage, to focus on episodes io9 says showed ratings losses improves the coefficient to about -0.042 ratings points, but it is still not significant (p 0.613, two-tailed). So, the moral of the story: the episodes identified may have been shark jumps, but they didn t seem to have a discernible effect on the ratings of subsequent episodes. And, besides, any analysis that doesn t identify the crapfest known as Black Market as a shark-jumping incident isn t worth taking seriously to begin with.

Bear in mind that TV ratings themselves leave something to be desired; variations of several tenths of a ratings point are within the expected margin of measurement error.

20 February 2009

Chris Lawrence: Be still my heart

From the description of the memisc package for R:
One of the aims of this package is to make life easier for useRs who deal with survey data sets. It provides an infrastructure for the management of survey data including value labels, definable missing values, recoding of variables, production of code books, and import of (subsets of) SPSS and Stata files. Further, it provides functionality to produce tables and data frames of arbitrary descriptive statistics and (almost) publication-ready tables of regression model estimates. Also some convenience tools for graphics, programming, and simulation are provided. [emphasis added]
How did I miss this package before? It makes analyzing NES data heck, any data with value labels and missing values in R an almost sane thing to do.

8 February 2009

Chris Lawrence: Repurposed content

Herein I present a rant on one-tailed tests in the social sciences; feedback welcome:
Unless you have a directional hypothesis for every coefficient before your model ever makes contact with the data, you have no business doing a one-tailed statistical test. Besides if your hypotheses are solid and you have a decent n, the tailedness shouldn t determine significance/lack thereof. Thought experiment: assume you present a test in a paper that comes out p=.06, one-tailed. That means you have a hypothesis that doesn t really work to begin with (sorry, approaches conventional levels of statistical significance ). More importantly, if you just made up the tailedness hypothesis post facto to put a little dagger (or heaven forbid a star) next to the coefficient, you really did a two-tailed test with p=.12 and then post-hoc justified it to make the finding sound better than it really was. Now here s the center of the rant: I really don t believe you actually knew the directionality of your hypothesis before you ran the test and were willing to stick with it through thick and thin, since I know that you d be figuratively jumping up and down with excitement and report a significant result if the sign was not as expected and it came out p=.003 two-tailed (p=.0015 one-tailed, opposite directionality), rather than lamenting how it turned out with p=.9985 on your original one-tailed test. I dare say nobody has ever published an article claiming the latter (although I might give it a positive review just for kicks). And I really don t feel the need to have these discussions with sophomores and juniors, hence why I prefer books that just talk about two-tailed tests (aka not Pollock [a textbook I really like otherwise]) so I don t feel the need to rant.
See also: this FAQ from UCLA, which is a little more lenient but not much.

25 January 2009

Chris Lawrence: In which I admit I am a dork

Instead of doing something productive today, I spent the day in San Antonio at an OpenStreetMap mapping party. I got to meet some interesting folks and play OpenStreetMap teacher some, and it s nice to be reminded that at least one of my dopey childhood hobbies has some practical application in the real world. And of course I got to put some more miles on the new car, which was fun too. Thanks to the folks at CloudMade, and particularly their community ambassador, for putting the meeting together as well as for the swag. I can t quite figure out how they think they re going to make money off of OSM, at least until the OSM data gets in a lot better shape, but I suppose that s their problem and not mine.
By the way, for those who ve hung on until this point (or were actually looking for some useful OpenStreetMap advice), here s my GPSBabel recipe for converting NMEA track logs from my Amod AGL3080 GPS logger into GPX track logs that can be imported into OpenStreetMap: gpsbabel -t -i nmea -f infile.log -x simplify,error=0.0005k -x discard,hdop=6 -o gpx -F outfile.gpx Basically this throws out bad GPS fixes and simplifies all of the data to throw out any points that would deviate from the current straight line by less than 0.5 meters. At least with the Amod GPS unit once it s got a good fix it seems to stay pretty accurate, even with the static navigation feature off (using the SN OFF firmware), as long as you don t leave it somewhere under partial cover.

16 December 2008

Chris Lawrence: GPS buying advice

Rich Owings of GPS Tracklog offers advice on must-have and less-worthwhile features for an automotive GPS. I ll slightly dissent from Rich on the value of traffic information, although of the units I ve used the Dash Express has the only helpful implementation* of traffic I ve found so far and with Dash leaving the hardware business it s not clear that anyone will be filling the gap in the future although TomTom s HD Traffic is allegedly headed stateside in 2009. * Virtually all of the existing products focus on Interstates and other freeways, which might be helpful in really big cities where there are multiple freeway routes to the same destination, but isn t so helpful in the places I ve lived where the question is not which freeway should I take? but should I take the freeway or one of the 2 3 surface street options? Dash at least has some data on traffic on the surface street network but much of it relies on Dash getting more market penetration, which seems unlikely unless they ve hooked up with a major player like TomTom to provide traffic services going forward.

15 December 2008

Chris Lawrence: On the filibuster

Nate Silver thinks Harry Reid is being an ineffective Senate majority leader because he s letting the GOP get away with holds without the traditional filibuster. However, as I pointed out here in 2003 (and also here later that year), the traditional filibuster is far more burdensome on the majority when the minority is bigger than a single senator; while you need 60 majority senators to be on-call to break the filibuster, all you need at any given point of time is a single minority senator to hold the floor. Ultimately the cot drama makes for nice TV, but dragging out the cots probably won t win him any friends among the supermajority of senators he needs to break the minority. These problems have also vexed other majority leaders of both parties if there s a common theme to in-partisans complaints about their majority leaders, it s ineffectuality, without much recognition that Senate majority leaders are institutionally weak and individual senators like it that way. It probably doesn t hurt that most senators have served in the House and the last thing they want is to have another Speaker trying to boss them around. On a related topic, McQ points out that the bailout had enough GOP support in the Senate to pass if Reid had successfully herded his party s cats. But again being a good cat-herder isn t really the qualification that fellow senators want when choosing their majority leader, so I m not sure anyone in Reid s position would have been able to do a better job.

12 December 2008

Chris Lawrence: Corollary of the day

King Politics thinks the GOP anti-bailout faction has the politics of the day wrong:
The time for pragmatism is now, but Senate Republicans don t recognize that. Senate Republicans have yet to realize that the GOP lost so many seats in 2006 and 2008 because the American public has a greater desire for pragmatism than ideology.
I think that s true to a point but I suspect it has more to do with post-Katrina George W. Bush than any coherent definition of ideology. As much as the Democrats would like to pretend otherwise, ideological is not a term I d readily apply to the bumbling nature of Bush s second term. Nor am I really convinced that the average voter is doing much more than engaging in post-hoc rationalized-as-something-else economic voting, which doubtless makes me no fun at parties when I play a public opinion scholar. ( Yes, all this crap matters at the margins, and occasionally elections are won at the margins, but most of the time it doesn t matter. ) But I digress. There is a broader lesson, though, in that to the extent the Democrats believe that their recent success is due to their ideology it is at their long-term peril, particularly if they bypass pragmatism in favor of catering to the cobbled-together collection of rent-seekers that passes for the Democratic coalition. To the extent bailing out Detroit is seen as a Democatic handout to its paymasters particularly with the emerging frame of the greedy unions are standing in the way trumping any sort of concept that any deal that tells the UAW to can their contract is essentially an impairment of the obligation of contract (which, believe it or not, is unconstitutional) the auto bailout won t go over well in the 48 or so states that don t host significant Big Three production. On a related note, Steven Taylor notes the defining-down of the filibuster by the media to mean failure to win a cloture vote. While I accept the point graciously, I think this may be more a failure of us as a profession than the media per se; modern congressional procedures (not just filibusters and holds, but also esoterica such as the Rules Committee and UCAs), even superficially treated, aren t a strong point of most American government textbooks, and more often than not that s the only real government orientation budding journalists will get. I make a point of assigning Barbara Sinclair s Unorthodox Lawmaking in my Congress classes, but I doubt the average journalist gets that in-depth in their undergrad days. So here at least I think the blame falls somewhat closer to home than we might want to admit.

Chris Lawrence: Corollary of the day

King Politics thinks the GOP anti-bailout faction has the politics of the day wrong:
The time for pragmatism is now, but Senate Republicans don t recognize that. Senate Republicans have yet to realize that the GOP lost so many seats in 2006 and 2008 because the American public has a greater desire for pragmatism than ideology.
I think that s true to a point but I suspect it has more to do with post-Katrina George W. Bush than any coherent definition of ideology. As much as the Democrats would like to pretend otherwise, ideological is not a term I d readily apply to the bumbling nature of Bush s second term. Nor am I really convinced that the average voter is doing much more than engaging in post-hoc rationalized-as-something-else economic voting, which doubtless makes me no fun at parties when I play a public opinion scholar. ( Yes, all this crap matters at the margins, and occasionally elections are won at the margins, but most of the time it doesn t matter. ) But I digress. There is a broader lesson, though, in that to the extent the Democrats believe that their recent success is due to their ideology it is at their long-term peril, particularly if they bypass pragmatism in favor of catering to the cobbled-together collection of rent-seekers that passes for the Democratic coalition. To the extent bailing out Detroit is seen as a Democatic handout to its paymasters particularly with the emerging frame of the greedy unions are standing in the way trumping any sort of concept that any deal that tells the UAW to can their contract is essentially an impairment of the obligation of contract (which, believe it or not, is unconstitutional) the auto bailout won t go over well in the 48 or so states that don t host significant Big Three production. On a related note, Steven Taylor notes the defining-down of the filibuster by the media to mean failure to win a cloture vote. While I accept the point graciously, I think this may be more a failure of us as a profession than the media per se; modern congressional procedures (not just filibusters and holds, but also esoterica such as the Rules Committee and UCAs), even superficially treated, aren t a strong point of most American government textbooks, and more often than not that s the only real government orientation budding journalists will get. I make a point of assigning Barbara Sinclair s Unorthodox Lawmaking in my Congress classes, but I doubt the average journalist gets that in-depth in their undergrad days. So here at least I think the blame falls somewhat closer to home than we might want to admit.

31 October 2008

Chris Lawrence: From the department of good but massively overpriced ideas

This thermostat sounded like a really great idea until I learned it costs $385. Surely someone can come up with a “dumber” digital thermostat that you can remotely adjust over WiFi much cheaper without the silly color touchscreen.

28 October 2008

Chris Lawrence: Say it ain't so: Joe target of database snoops

Via my Facebook updates feed, the Columbus Dispatch reports that records of “Joe the Plumber” have been looked up in various Ohio databases, potentially in violation of various privacy laws. As I noted over at OTB during the Obama/Clinton/McCain passport snooping controversy, the snooping in this case was almost certainly the result of what was called “imprudent curiosity” in those incidents rather than a concerted effort to dig up dirt on everyone’s favorite small-business owner. That isn’t to excuse the snooping, mind you. Update: Michelle identifies a broader issue at work here.

27 October 2008

Chris Lawrence: Newspeak, Yglesias style

I think this quote (regarding the California High-Speed Rail Initiative) is far more revealing than Matthew intends it to be:
[I]t seems to me that the sad reality of politics is that it would be irresponsible for advocates of any large-scale infrastructure project to do anything other than present unrealistically optimistic measures.
Translation into English: it would be irresponsible for advocates of at least some policies Matthew Yglesias prefers to tell the truth. Oxford’s New American Dictionary defines “responsibility to” as “a moral obligation to behave correctly toward or in respect of.” So Yglesias believes it would be immoral for advocates of some of Yglesias’ preferred policies to be honest. I’m glad we have that cleared up.

26 October 2008

Chris Lawrence: Inside baseball

I’ve been remiss in pointing my readers recently to Zachary Schrag’s Institutional Review Blog, which patiently documents the overreach and misapplication of federal regulations regarding the protection of human subjects to the social and behavioral sciences, including research that by federal regulation is exempt from review by IRBs. While Schrag is cautiously optimistic that the new head of the Office of Human Research Protections will be an improvement, the continued domination of the process at most levels by biomedical researchers—along with the general sense that, as Schrag notes, “researchers cannot be trusted to apply the exemptions themselves”—is still troubling to those of us who want to conduct human subjects research, particularly secondary data analysis. Technically speaking (even though I dare say most social scientists observe this requirement in the breach), even the analysis of secondary data collected by others and fully anonymized before we see it (e.g. use of data such as the General Social Survey, American National Election Studies series, the Eurobarometer series, etc.) requires IRB oversight and approval beforehand.

24 October 2008

Chris Lawrence: Satisficing or incomplete information?

It occurred to me this morning, as I was pondering our forthcoming ads for two political science positions and a conversation I had yesterday with some other social scientists, that had I accepted either of the tenure-track jobs I was offered before coming to TAMIU, I’d never have even applied for this job even though on most dimensions, at least in my personal judgment, it’s a better position than either of those were/are. I’m not really sure what this all means, but I figured letting my readers engage in something a step above dream analysis might be more interesting than not posting anything today.

23 October 2008

Chris Lawrence: Bust a move

I enjoyed last night’s episode of Mythbusters for a variety of reasons. For starters, I now have Smart Board Envy™, projectiles and explosions are always fun, and seeing Adam, Jamie, and Kari drunk was a hoot. The social scientist in me, though, really enjoyed the “beer goggles” experiment. In fact, the show, edited down to just include that section, would make a great primer on “how social scientific experiments work” for my undergraduate methods course when I teach it again, presumably next fall. On the other hand, I was less thrilled with the “sobering up” experiment, but the comedy factor of drunken Adam trying to run on a treadmill without a handrail, with all-too-predictable results, made up for the scientific shortcomings therein.

12 October 2008

Chris Lawrence: QotD, five miles uphill each way to school edition

Jacob T. Levy on his introduction of photos at his eponymous blog:
I hear that the interwebs are now capable of handling things that aren’t even text. (In my day, we browsed the interwebs on lynx in UNIX and read e-mail on Pine and we liked it!)
Heh; while my first exposure to true Internet access (in the summer of 1992, before the invention of the img tag and widespread use of the web) was rather more slick due to the wonders of NeXTSTEP, the ancient ancestor of Mac OS X, even that was an incredibly texty experience by today’s standards. Over the intervening years, I’ve certainly spent my fair share of time with lynx and Pine and their more modern siblings (elinks and mutt).

9 October 2008

Chris Lawrence: The dark side

Steven Taylor is considering going dual-boot. For better or worse, I think Ubuntu is probably the best choice for a newbie these days, although my last lenny install was surprisingly painless (except for the whole “MacBooks have very funky partitioning” issue which I’ve never really been able to resolve to my satisfaction).

Next.