Skip to content

Compatibility with different versions of Stata #28

@briatte

Description

@briatte

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.)

  • Currently (2021 2023), that means going back to Stata 11-12 13, so Stata 12+ 13+ compatibility seems like a reasonable goal. This would avoid e.g. having to enclose calls to marginsplot in "if version" conditionals.
  • A more reasonable goal is to support Stata 13+ only, primarily because of UTF-8 and HTTPS support. Stata 13 was released in 2013, so supporting Stata 13+ would be an ideal goal for… 2023. (Update: it's 2023, and this is now a good goal.)
  • Some stuff like the syntax of ci and changes to the defaults of margins (for xtlogit, re, so not affecting the course) suggest supporting only Stata 14+. That's the lazy option.

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).

  • Requires checking the QOG dataset (updated below in 2023)
    • qog2019 is fine, 1,983 vars (leaves 65 free for the Stata/MP user to create)
    • 2020, 2021, 2023 editions are at ~ 1,700 vars
    • see Dataset updates #30 to understand why sticking with qog2019 makes sense
  • Requires changing the GSS dataset by breaking it down to multiple years

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.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions