briatte / srqm

An introductory statistics course for social scientists, using Stata
https://f.briatte.org/teaching/quanti/
49 stars 17 forks source link

Compatibility with different versions of Stata #28

Open briatte opened 3 years ago

briatte commented 3 years ago

Closes #12 and #18 in favour of a reassessment in early 2021 2023 (updated).

The ideal goal would be to maintain compatibility with all (SE/IC/MP) versions of Stata released in the last 10 years, with a focus on Stata SE.

(For reference, the course started running shortly after Stata 11.1 was released, and I think I remember testing it with Stata 10, from June 2007, possibly even Stata 9, April 2005.)

Given the above and some of the details below, the lazy objective of supporting only the last 3 versions (Stata 14+) might be more reasonable… Stata 14 was released in 2015, so that would result in a 5-year compatibility window, which is not so shabby.

Dataset format

There are comments about this in srqm_data.ado on that. The current format for all teaching datasets in Stata 12.

Number of variables

2,048 at most for Stata/IC.

Solution: warn (or fail?) if datasets go over 2,048 - 100 variables in srqm_data.ado (leaving 100 variables for the user).

GSS limited to 1976 and 2016 has ~ 1,100 vars and weighs 7.7 MB -- that should work.

keep if year==1976 | year == 2016
d, varl
foreach i of varlist `r(varlist)' {
    di "`i'"
    count if !mi(`i')
    if r(N) == 0 {
        drop `i'
    }
}

HTTPS

Discussed in #12. It's probably time to drop HTTP support — there is no satisfying solution to continue doing so, the course is available outside of Sciences Po only via HTTPS-only GitHub, and all Sciences Po students are on HTTPS.

There are more comments about this (HTTP/S on my Stata access point) in srqm_grab.ado.

Import commands for non-DTA data

srqm_grab.ado contains commands to import CSV/TSV and Excel data in Stata: it will show the commands to do so for Stata 13+ (one more argument in favour of dropping Stata 12 at that stage).

Outdated commands

memory fails gracefully. Affects week1.do.

ci does not fail gracefully — it does not require mean in Stata 12 or in Stata 13, but does in Stata 14+. Affects week4.do and week5.do.

marginsplot is not supported in Stata 11-. Affects week11.do.