Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mayer79/actools
Tools for actuary science
https://github.com/mayer79/actools
Last synced: 1 day ago
JSON representation
Tools for actuary science
- Host: GitHub
- URL: https://github.com/mayer79/actools
- Owner: mayer79
- License: gpl-3.0
- Created: 2019-06-02T10:19:20.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-06-04T06:46:21.000Z (over 5 years ago)
- Last Synced: 2024-10-04T12:56:53.509Z (2 months ago)
- Language: R
- Size: 273 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: NEWS.md
- License: LICENSE
Awesome Lists containing this project
- jimsghstars - mayer79/actools - Tools for actuary science (R)
README
# actools
Tools for actuarial science.
## DescriptionThe package can e.g. be used to extract coefficient tables from an all-factor linear regression model with arbitrarily interaction levels fitted by `lm`.
## Examples
``` r
# devtools::install_github("mayer79/actools/Release/actools")
library(actools)CO2[["conc"]] <- factor(CO2[["conc"]])
fit <- lm(uptake ~ Type:Treatment + conc:Treatment + Type:conc, data = CO2)
(coefT <- coefTables(fit, rebase = TRUE))
head(pred_classic <- predict(fit, CO2))
head(pred_fancy <- predict(coefT, CO2))
perf(CO2$uptake, pred_classic, lab = "classic")
perf(CO2$uptake, pred_fancy, lab = "fancy")# Same with logs
fit <- lm(log(uptake) ~ Type:Treatment + conc:Treatment + Type:conc, data = CO2)
(coefT <- coefTables(fit, rebase = TRUE))
head(pred_classic <- exp(predict(fit, CO2)))
head(pred_fancy <- predict(coefT, CO2, trafo = exp))perf(CO2$uptake, pred_classic, lab = "classic")
perf(CO2$uptake, pred_fancy, lab = "fancy")
```## References