Skip to content

Publishing

fw_publish

Publish a figure, table, document, or estimation results

fw_publish publishes one file: a figure, a table, a rendered HTML document with its name_files folder, or any other file. Each publish adds a version and keeps the earlier ones.

fw_publish, estimates publishes the current estimation results as a model: a coefficient table with standard errors, test statistics, p-values, and confidence intervals, plus fit statistics. Framework Cloud and the offline reader show it like a model published from R or Python.

Usage

fw_publish filename [, options]
fw_publish, estimates [options level(#) saving(filename [, replace])]

Options

Name Default Description
filename

The file to publish. Leave it out with estimates.

estimates

Publishes the current estimation results as a model.

slug(string)

The artifact's name in its link. The default comes from the file name.

title(string)

The title readers see.

description(string)

A short description.

to(destination)

cloud, github, s3, or a destination named in the project settings. A folder destination must be named, with a path.

visibility(string)

public, unlisted, or private. On Framework Cloud, a new artifact without it is unlisted, and a later publish without it keeps the current visibility.

private

Short for visibility(private).

includeprivate

Confirms files with "private" in their path.

kind(string)

Overrides the detected kind, such as image or html.

level(#) c(level)

The confidence level, with estimates. The default is 95 unless changed with set level. The estimation command's own level() is not read.

saving(filename [, replace])

Keeps a copy of the model document, with estimates.

Value

  • r(url): the published link, when the destination has one
  • r(location): the published folder, for folder destinations
  • r(version): the version number
  • r(version_url): the link to this version
  • r(destination): the destination name
  • r(driver): cloud, folder, github, or s3
  • r(backend): core, cli, or python
  • r(slug): the artifact name
  • r(file): the file that was published; with estimates, the saving() copy, else empty

Every backend sets these results. A result is empty when the destination does not report it.

Destinations

Without to(), fw_publish uses publish.default in the project settings, then Framework Cloud. Named destinations live in the settings under publish.destinations. A folder destination needs a path, so to(folder) alone stops with an error.

Stata publishes to folders and to Framework Cloud itself. GitHub Pages and S3 need fw or framework-py; see fw_set. Framework Cloud uploads use the project token in the project's .env file.

Estimation commands

regress, logit, logistic, probit, poisson, nbreg, glm, mixed, stcox, and ivregress map to Framework's model types with the right family, link, and ratio label. Other commands with e(b) and e(V) publish a generic coefficient table.

Estimates stay on the model scale. _cons becomes (Intercept). Base and omitted factor levels are left out. mixed adds a random-effects table for independent, identity, exchangeable, and unstructured covariance. nbreg reports alpha or delta as a fit statistic. Other free parameters, such as tobit's var(e.y), go in an ancillary table, without a test where Stata shows none.

Private paths

A file whose full path contains "private", in any case, needs confirmation. Interactive Stata asks. Batch mode stops with error 198 until you add the includeprivate option. R, Python, and fw follow the same rule. The private option sets visibility, not this confirmation.

With estimates, the rule checks the file the data in memory came from: the last fw_use or fw_save, or c(filename) when a plain use or save has loaded another file since. Results fit to data from a path with "private" in it need the same confirmation.

Examples

A figure Not run

graph export "$fw_outputs_figures/price.png", replace
fw_publish "$fw_outputs_figures/price.png", title("Price and mileage")

A model to a named destination Not run

sysuse auto, clear
regress price mpg weight
fw_publish, estimates slug(price-model) to(lab)

Related reference