Demo entry 6628262

Stata code sample

   

Submitted by anonymous on Jul 03, 2017 at 02:27
Language: Stata. Code size: 469 Bytes.

// horizon
local horizon = 1

// Do for each file
foreach file in `files' {
	noi LogShow Processing file `file'
	use ./GeneratedData/StataFiles/d`file'.dta, clear
	// Remove variables that are not present from the list of variables
	di "List of variables removed (if any): " _c
	foreach v in `allvars' {
		cap confirm numeric variable `v'
		// if variable
		if _rc!=0 {
			local allvars = subinword("`allvars'","`v'","",1)
			di "`v' " _c
		}
	}
	di ""

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).