*! version 1.0.1 21aug2026

Title

gvar getdata -- fetch the example datasets, which ship separately

Syntax

gvar getdata [group] , from(ssc|net) pkg(string) [options]

group is demo (the default), extra, weights, all,
or an explicit list of dataset names.

options

from(ssc|net) where to fetch from. Required.

pkg(string) the SSC package name, or the URL for from(net). Required.

dir(path) where to put the files. Default: the current directory.

list show the dataset names and groups, fetch nothing.

replace overwrite files already present. Default: keep them.

nosummary suppress the report.

Description

gvar getdata downloads the example datasets. They are not installed
with the package, so this is how you get them.

Four are all the documented examples need:

gvar_demo26.dta the demo panel, 26 economies, 1979Q2-2013Q1

gvar_flows.dta bilateral trade flows

gvar_demospec.dta the specification grid

gvar_demoagg.dta the euro-area crosswalk

gvar getdata, list shows the rest: an unaggregated 33-country panel, a
regional crosswalk, effective exchange rates, an alternative panel, price
volatility series, and fifteen alternative link-weight matrices.

Options

from(ssc|net) names the mechanism. ssc uses ssc copy;
net uses net get against a URL. There is no default:
choosing a download source on your behalf is not this command's business.

pkg(string) is the SSC package holding the datasets, or the URL with
from(net). Also required, for the same reason.

dir(path) sets the destination, created if absent. Whatever you choose
must be somewhere use can find, or pass the full path to use.

replace overwrites. Without it a file already present is kept and
reported as kept -- you may have edited a local copy, and this command should
not destroy it silently.

A fetch that fails reports the return code per file and says plainly that the
problem is with the source, not with your installation, together with the
command to inspect that source. A download failure and a broken install need
different fixes and should not produce the same message.

Why the data is separate

The SSC Archive caps a package description at 100 lines. Listing 26
datasets as f lines put this package at 114, and it was refused.

Kit Baum, who maintains the archive, gave the remedy: keep the data out of the
package and fetch it with one command --

"if the .dta files could be installed from a single command, those files can
be available from SSC using ssc copy commands, so you would just need a single
ado that invokes ssc copy commands for each of the ... datasets"

That is this command. Nothing was dropped from the project: every dataset
the documentation mentions is still available. It arrives when you ask for it
instead of at install time.

The alternative -- deleting the data -- would have made the documented examples
unrunnable, and that is not a trade worth making to save lines in a
description file.

The 648 Pesaran-Shin-Smith cointegration critical values went the other way.
They used to ship as gvar_cv.dta and gvar coint read
them with findfile, refusing with r(601) if the file was missing.
They are constants, so they now live in the Mata engine.
gvar coint needs no data file at all, and this command does not fetch
them because there is nothing to fetch.

Examples

See what there is:

. gvar getdata, list

The four the examples use, from a companion SSC package:

. gvar getdata demo, from(ssc) pkg(gvardata)

Everything, into a folder of your choosing:

. gvar getdata all, from(ssc) pkg(gvardata) dir(C:/mydata)

Two named datasets, overwriting local copies:

. gvar getdata gvar_demo26 gvar_flows, from(ssc) pkg(gvardata) replace

Then the worked analysis in net get gvar runs.

Stored results

gvar getdata stores the following in r():

r(got) files fetched

r(skipped) files already present and kept

r(nfail) files not fetched

r(files) the names requested

r(failed) the names that failed

With list: r(demo), r(extra), r(weights), r(all).

Author

Dr Merwan Roudane

merwanroudane920@gmail.com

https://github.com/merwanroudane