https://github.com/remlapmot/reffadjust
Stata commands for random effects adjustment
https://github.com/remlapmot/reffadjust
multilevel-models multilevelmodels randomeffects stata
Last synced: 5 months ago
JSON representation
Stata commands for random effects adjustment
- Host: GitHub
- URL: https://github.com/remlapmot/reffadjust
- Owner: remlapmot
- Created: 2018-10-12T08:36:48.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2025-06-06T12:40:32.000Z (about 1 year ago)
- Last Synced: 2025-06-07T12:07:02.684Z (about 1 year ago)
- Topics: multilevel-models, multilevelmodels, randomeffects, stata
- Language: Stata
- Size: 242 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Stata commands for random effects adjustment: the reffadjust package
The `reffadjust` package provides postestimation commands to perform adjustment of random effects estimates.
The `reffadjust` commands are:
- `reffadjustsim`: simulating from the distribution of random effect variances and covariances
- `reffadjust4nlcom`: regression coefficient formula to pass to `nlcom`.
Since multilevel models including random effects, such as those implemented in `MLwiN` and `mixed`/`xtmixed`, return estimates of the variances and covariances of the random effects and the corresponding variances and covariances of these estimates we can use these to estimate adjusted coefficients.
The approach is described in more detail in Macdonald-Wallis et al. (2012) and Palmer et al. (2014).
## Installation
To install, issue in Stata (in versions 13 and above) using the **github** package, first install the **github** package:
```stata
net install github, from("https://haghish.github.io/github/")
```
then run
```stata
github install remlapmot/reffadjust
```
Alternatively use `net install` directly as follows
```stata
net install reffadjust, from("https://raw.github.com/remlapmot/reffadjust/master/")
```
### Installation of MLwiN
This is available from .
The MLwiN libraries are now available natively for macOS (both Intel and Apple Silicon Macs) and a range of Linux ditributions.
On macOS the `mlnscript` and `libmln.dylib` files must be granted permission to run in _System Settings_ | _Privacy and Security_ | Scroll down to _Security_ section. See my [blogpost](https://remlapmot.github.io/post/2024/mlnscript-r2mlwin-apple-silicon/) for more details.
## Running tests
Either, in Stata change directory to the _cscripts_ directory and run
```stata
do master
```
or from a terminal session run the _test_ recipe in the justfile
```sh
just test
```
## Acknowledgements
Thanks to Gemma Clayton for discovering that `reffadjustsim` had stopped working under a recent version of Stata. And thanks to Stata Corp. for providing me with a fix for this issue.
## Notes
- 2025-12-17 Tested under MLwiN 3.17 and StataNow 19.5 on macOS M4 chip
- 2025-10-20 Tested under MLwiN 3.16 and StataNow 19.5 on macOS M4 chip
- 2025-10-17 reffadjust now has a website
- 2025-10-12 Tested under MLwiN 3.15 and StataNow 19.5 on macOS M4 chip
- 2025-09-26 Tested under MLwiN 3.14 and StataNow 19.5 on macOS M4 chip
- 2025-06-06 Tested under MLwiN 3.14 and StataNow 18.5 on macOS M4 chip
- 2025-04-05 Tested under MLwiN 3.13 and StataNow 18.5 on macOS M4 chip
- 2025-03-20 Tested under MLwiN 3.13 and StataNow 18.5 on macOS and Windows 11
- 2024-10-12 Tested under MLwiN 3.13 and StataNow 18.5
- 2024-08-12 Tested under MLwiN 3.12 and StataNow 18.5
- 2024-06-15 Tested under MLwiN 3.11 and StataNow 18.5
- 2024-03-19 Tested under MLwiN 3.10 and Stata 18.0
- 2024-01-30 Tested under MLwiN 3.09 (and Stata 18)
- 2024-01-29 Tested on Stata 18 and macOS
## References
- Macdonald-Wallis C, Lawlor DA, Palmer TM, Tilling K. Multivariate multilevel spline models for parallel growth processes: application to weight and mean arterial pressure in pregnancy. Statistics in Medicine, 2012, 31, 26, 3147--3164.
- Palmer TM, Macdonald-Wallis CM, Lawlor DA, Tilling K. Estimating adjusted associations between random effects from multilevel models: the reffadjust package. Stata Journal, 2014, 14, 1, 119--140.