Quantcast
Channel: Statalist
Viewing all articles
Browse latest Browse all 65122

Understanding macro syntax

$
0
0
I use a macro to define the URL for a dataset downloaded from Harvard Dataverse using copy:
Code:
local unvotingdata "https://dataverse.harvard.edu/api/access/datafile/2839238?format=original"
copy `unvotingdata' "RawVotingdata.dta", replace
This returns a "varlist not allowed" error, but if I enclose the call to the macro in double quotation marks, it works fine:
Code:
local unvotingdata "https://dataverse.harvard.edu/api/access/datafile/2839238?format=original"
copy "`unvotingdata'" "RawVotingdata.dta", replace
I copy other datasets from URLs input as macros without double quotation marks, so I'd appreciate an explanation for why Stata needs them here.

Viewing all articles
Browse latest Browse all 65122

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>