the meps household component leads the pack for examining individual-level medical expenditures by payor and type of service. total expenditures captured by the survey tend to be low, but unbiased across the board and can be adjusted to match the...
the meps household component leads the pack for examining individual-level medical expenditures by payor and type of service. total expenditures captured by the survey tend to be low, but unbiased across the board and can be adjusted to match the...
I sometimes get asked about forecasting many time series automatically. Here is a recent email, for example: I have looked but cannot find any info on generating forecasts on multiple data sets in sequence. I have been using analysis services for sql server to generate fitted time series but it is too much of a black box (or I...
It happens all the time: you have a vector of fruits and you want to replace all bananas with apples, all oranges with pineapples, and leave all the other fruits as-is, or maybe change them all to figs. The usual solution? A big old nested `ifelse`: ...
You have an SQLite database, perhaps as part of some replication materials, and you want to query it from R. You might want to be able to say: results <- runsql("select * from mytable order by date") and get the results back as an R object. Here's a function to do it. In the following,
Few of us can resist chocolate, but the real question is: should we even try to resist it? The image is CC by Tasumi1968.
The R language provides many features in the language for selecting data from data frames: the "[" operator, logical functions, and utility functions like "subset". But if you know SQL (the query language ubiquitous in database systems), none of this is necessary. With the sqldf package, you can just pretend that your data frame is a database, and use...