growth: Compute growth rates of indexes

Description Usage Arguments Value Author(s) Examples

View source: R/funcs_multilateral.R

Description

This function computes growth rates of variables for panel data sets.

Usage

1
growth(dataset, var.agg)

Arguments

dataset

A data frame containing numerical data, id and time variables. The panel should be arranged in long format.

var.agg

The name of id variables contained in the dataset. The temporal dimension should be the first element while the spatial should be the second one.

Value

It returns the data frame of growth rates indexed by time and id.

Author(s)

Edoardo Baldoni

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
library(parallel)
library(igraph)
library(ape)

data('multil_data')
indx = multilateral(dat.q,dat.p,var.agg=c('year','region'),
 transitivity = 'mst', bench = 1, period =2010,
 idx = 'fisher', PAR= FALSE, Cores = detectCores(),plotting= FALSE)
 
indx = as.data.frame(do.call('cbind',list(indx)))
names(indx) = 'indx'
## try
indx$year = substr(rownames(indx),start=nchar(rownames(indx))-3,stop=nchar(rownames(indx)))
indx$region = substr(rownames(indx),start=nchar(rownames(indx))-6,stop=nchar(rownames(indx))-5)

growth(indx, var.agg=c('year','region'))

multilaterals documentation built on May 2, 2019, 4:02 p.m.