ts_parlin: Time-indicator serie to straight lines parameters

View source: R/ts_parlin.R

ts_parlinR Documentation

Time-indicator serie to straight lines parameters

Description

Given a dataset with first column times and second column the indicator values parameters of time-spliced straight lines are calculated. No checking is performed in input. Time values must differ by a positive constant.

Usage

ts_parlin(dataMat)

Arguments

dataMat

two columns (times, indicator) dataset

Value

dataset(tibble) where each row is (times, intercept, slope)

References

https://www.eurofound.europa.eu/system/files/2022-04/introduction-to-the-convergeu-package-0.6.4-tutorial-v2-apr2022.pdf

Examples


require(tibble)
testTB <- dplyr::tribble(
    ~time, ~countryA ,  ~countryB,  ~countryC,
    2000,     0.8,   2.7,    3.9,
    2001,     1.2,   3.2,    4.2,
    2002,     0.9,   2.9,    4.1,
    2003,     1.3,   2.9,    4.0,
    2004,     1.2,   3.1,    4.1,
    2005,     1.2,   3.0,    4.0
    )

curcountry <- 2
resPAR <- ts_parlin(testTB[,c(1,curcountry)])

curcountry <- 4
resPAR1 <- ts_parlin(testTB[,c(1,curcountry)])


convergEU documentation built on May 29, 2024, 11:15 a.m.