sils | R Documentation |

`sils`

estimates gravity models via
Structural Iterated Least Squares and an explicit inclusion
of the Multilateral Resistance terms.

```
sils(
dependent_variable,
distance,
additional_regressors = NULL,
income_origin,
income_destination,
code_origin,
code_destination,
maxloop = 100,
decimal_places = 4,
robust = FALSE,
verbose = FALSE,
data,
...
)
```

`dependent_variable` |
(Type: character) name of the dependent variable. This dependent variable is
divided by the product of unilateral incomes such (i.e. |

`distance` |
(Type: character) name of the distance variable that should be taken as the key independent variable in the estimation. The distance is logged automatically when the function is executed. |

`additional_regressors` |
(Type: character) names of the additional regressors to include in the model (e.g. a dummy
variable to indicate contiguity). Unilateral metric variables such as GDP should be inserted via the arguments
Write this argument as |

`income_origin` |
(Type: character) origin income variable (e.g. GDP) in the dataset. |

`income_destination` |
(Type: character) destination income variable (e.g. GDP) in the dataset. |

`code_origin` |
(Type: character) country of origin variable (e.g. ISO-3 country codes). The variables are grouped using this parameter. |

`code_destination` |
(Type: character) country of destination variable (e.g. country ISO-3 codes). The variables are grouped using this parameter. |

`maxloop` |
(Type: numeric) maximum number of outer loop iterations. The default is set to 100. There will be a warning if the iterations did not converge. |

`decimal_places` |
(Type: numeric) number of decimal places that should not change after a new iteration for the estimation to stop. The default is set to 4. |

`robust` |
(Type: logical) whether robust fitting should be used. By default this is set to |

`verbose` |
(Type: logical) determines whether the estimated coefficients
of each iteration should be printed in the console. The default is set
to |

`data` |
(Type: data.frame) the dataset to be used. |

`...` |
Additional arguments to be passed to the function. |

`sils`

is an estimation method for gravity models
developed by \insertCiteHead2014;textualgravity.

The function `sils`

utilizes the relationship between the Multilateral
Resistance terms and the transaction costs. The parameters are estimated by
an iterative procedure. The function executes loops until the parameters
stop changing significantly.

`sils`

is designed to be consistent with the Stata code provided at
Gravity Equations: Workhorse, Toolkit, and Cookbook
when choosing robust estimation.

As, to our knowledge at the moment, there is no explicit literature covering
the estimation of a gravity equation by `sils`

using panel data,
and we do not recommend to apply this method in this case.

The function returns the summary of the estimated gravity model as an
`lm`

-object. It furthermore returns the resulting coefficients for each
iteration.

For more information on gravity models, theoretical foundations and estimation methods in general see

\insertRefAnderson1979gravity

\insertRefAnderson2001gravity

\insertRefAnderson2010gravity

\insertRefBaier2009gravity

\insertRefBaier2010gravity

\insertRefFeenstra2002gravity

\insertRefHead2010gravity

\insertRefHead2014gravity

\insertRefSantos2006gravity

and the citations therein.

See Gravity Equations: Workhorse, Toolkit, and Cookbook for gravity datasets and Stata code for estimating gravity models.

For estimating gravity equations using panel data see

\insertRefEgger2003gravity

\insertRefGomez-Herrera2013gravity

and the references therein.

`lm`

, `coeftest`

,
`vcovHC`

```
# Example for CRAN checks:
# Executable in < 5 sec
library(dplyr)
data("gravity_no_zeros")
# Choose 5 countries for testing
countries_chosen <- c("AUS", "CHN", "GBR", "BRA", "CAN")
grav_small <- filter(gravity_no_zeros, iso_o %in% countries_chosen)
fit <- sils(
dependent_variable = "flow",
distance = "distw",
additional_regressors = "rta",
income_origin = "gdp_o",
income_destination = "gdp_d",
code_origin = "iso_o",
code_destination = "iso_d",
maxloop = 50,
dec_places = 3,
robust = FALSE,
verbose = FALSE,
data = grav_small
)
```

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.