plot_transition: Plot the transition function of the estimated PSTR model.

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/utils.R

Description

This function plots the transition function of the estimated PSTR model.

Usage

1
plot_transition(obj, log_scale = F, size = 1.5, color = "black", ...)

Arguments

obj

an object of the class PSTR returned from some functions in the package. Note that the corresponding PSTR model must be estimated first.

log_scale

specify whether to use log transformation for x-axis.

size

the size of the circle.

color

the color of the circle.

...

expression or strings of names passed to the labs function in ggplot2. The names should be some of "x", "y", "title", "subtitle", and "caption".

Details

The funciton uses some functions in the ggplot2 package and aims to give a quick plot of the transtion function. The user can customize the title, subtitle, caption, x and y labels, for details, read the help file for the labs function in ggplot2.

Value

A ggplot object. The user can plot it simply by print the object.

Author(s)

Yukai Yang, yukai.yang@statistik.uu.se

See Also

Functions which return an object of the class PSTR and can be input into this function

EstPSTR

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
pstr = NewPSTR(Hansen99, dep='inva', indep=4:20, indep_k=c('vala','debta','cfa','sales'),
    tvars=c('vala'), iT=14) # create a new PSTR object

# estimate the PSTR model
pstr = EstPSTR(use=pstr, im=1, iq=1, useDelta=TRUE, par=c(1.6,.5), method='CG')

# plot the transition function

ret = plot_transition(pstr)
# plot by running
ret

ret = plot_transition(pstr, color = "blue", size = 2,
    x="customize the label for x axis",y="customize the label for y axis",
    title="The Title",subtitle="The subtitle",caption="Make a caption here.",log_scale=TRUE)
ret

lxylky1688/PSTRM documentation built on May 19, 2019, 1:47 a.m.