Description Usage Arguments Details Value Author(s) See Also Examples
This function plots the transition function of the estimated PSTR model.
1 | plot_transition(obj, log_scale = F, size = 1.5, color = "black", ...)
|
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 |
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.
A ggplot object. The user can plot it simply by print the object.
Yukai Yang, yukai.yang@statistik.uu.se
Functions which return an object of the class PSTR and can be input into this function
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
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.