Learn R Programming

multilaterals (version 2.0)

growth: Compute growth rates of indexes

Description

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

Usage

growth(dataset, var.agg)

Value

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

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.

Author

Edoardo Baldoni

Examples

Run this code

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'))

Run the code above in your browser using DataLab