ioprofile              package:ordinal              R Documentation

_P_r_o_d_u_c_e _I_n_d_i_v_i_d_u_a_l _O_r_d_i_n_a_l _T_i_m_e _P_r_o_f_i_l_e_s _f_o_r _P_l_o_t_t_i_n_g

_D_e_s_c_r_i_p_t_i_o_n:

     'ioprofile' is used for plotting individual ordinal profiles over
     time for objects obtained from dynamic models. It produces output
     for plotting recursive undelying means, recursive highest
     probabilities, and recursive cumulative probabilities for
     individual ordinal time profiles from such models.

     See 'moprofile' for plotting marginal ordinal profiles.

_U_s_a_g_e:

     plot(ioprofile(z,curve.type="mean"),nind=1,observed=T,main=NULL,
          xlab=NULL,ylab=NULL,xlim=NULL,ylim=NULL,lty=NULL,pch=NULL,
          add=F,axes=F,bty="n",at=NULL,touch=F,...)

_A_r_g_u_m_e_n_t_s:

       z: An object of class 'kalordinal', from 'kalord'.

curve.type: Specifies the type of curves to be plotted. Must either be
          "mean" for recursive underlying means, "probability" for
          recursive highest probabilities, "both" for recursive
          predictions (recursive underlying means and recursive highest
          probabilities), or "cumulative" for recursive cumulative
          probabilities.

    nind: Observation number(s) of individual(s) to be plotted.

observed: If TRUE, adds the corresponding observations to the plot. If
          cumulative curves have been chosen, they are added as a
          subtitle.

    main: A main title for the plot.

    xlab: A label for the x-axis.

    ylab: A label for the y-axis.

    xlim: The x limits (min,max) of the plot.

    ylim: The y limits (min,max) of the plot.

     lty: A vector of integers or character strings specifying the line
          type to be used as the default in plotting lines. For further
          information, see 'par'.

     pch: A vector of integers or single characters specifying symbols
          to be used as the default in plotting points. For further
          information, see 'par'.

     add: If TRUE, the graph is added to an existing plot.

    axes: If FALSE, axes are not drawn around the plot.

     bty: A character string which determined the type of box which is
          drawn about plots. For further information, see 'par'.

      at: The points at which tick-marks are to be drawn. For further
          information, see 'axis'.

   touch: If TRUE, the x-axis and y-axis will touch each other.

_V_a_l_u_e:

     'ioprofile' returns information ready for plotting by
     'plot.ioprofile'.

_A_u_t_h_o_r(_s):

     P.J. Lindsey

_S_e_e _A_l_s_o:

     'kalord', 'moprofile', 'plot.ordinal', 'poprofile'.

_E_x_a_m_p_l_e_s:

     library(ordinal)

     #
     # Binary data
     #
     data(cardiac.indiv)

     y <- restovec(cardiac.indiv[,1:4],type="ordinal")

     cov <- tcctomat(as.matrix(cardiac.indiv[,5:10]))

     w <- rmna(y,ccov=cov)

     rm(cardiac.indiv,y,cov)

     # Time-constant and time-varying covariate with a frailty dependence.
     z <- kalord(w,distribution="binary",mu=~age+ren+cop+dia+sex+pmi+times,
                 ptvc=c(4.43357,-0.03128,-0.62602,-0.37679,-0.32969,-0.17013,
                        -0.12209,-0.09095),pinit=0.1196,dep="frailty")

     # Recursive mean profiles.
     par(mfrow=c(2,2))
     plot(ioprofile(z,"mean"),nind=1)
     plot(ioprofile(z,"mean"),nind=5)
     plot(ioprofile(z,"mean"),nind=c(1,5))
     plot(ioprofile(z,"mean"),nind=12)
     par(mfrow=c(1,1))

     # Recursive highest probability profiles.
     par(mfrow=c(2,2))
     plot(ioprofile(z,"prob"),nind=1)
     plot(ioprofile(z,"prob"),nind=5)
     plot(ioprofile(z,"prob"),nind=c(1,5))
     plot(ioprofile(z,"prob"),nind=12)
     par(mfrow=c(1,1))

     # Recursive predicted profiles.
     par(mfrow=c(2,3))
     plot(ioprofile(z,"both"),nind=1)
     plot(ioprofile(z,"both"),nind=5)
     plot(ioprofile(z,"both"),nind=12)
     plot(ioprofile(z,"both"),nind=c(1,5,12),add=T)
     par(mfrow=c(1,1))

     # Recursive cumulative probability profiles.
     par(mfrow=c(2,2))
     plot(ioprofile(z,"cum"),nind=1)
     plot(ioprofile(z,"cum"),nind=5)
     plot(ioprofile(z,"cum"),nind=c(1,5),add=T)
     par(mfrow=c(1,1))

     rm(w,z)

     #
     # Ordinal data
     #
     data(tmi2)

     y <- restovec(tmi2[,1:4],type="ordinal")

     cov <- tcctomat(tmi2[,5],name="distance")

     w <- rmna(y,ccov=cov)

     rm(tmi2,y,cov)

     # Proportional-odds model with time-constant covariate with a Markov dependence.
     z <- kalord(w,distribution="proportional-odds",ccov=~distance,
                 preg=c(-1.89,11.652,-0.199),pinit=3.111,pdep=0.217,dep="Markov")

     # Recursive mean profiles.
     par(mfrow=c(2,2))
     plot(ioprofile(z,"mean"),nind=1)
     plot(ioprofile(z,"mean"),nind=268)
     plot(ioprofile(z,"mean"),nind=c(1,268))
     plot(ioprofile(z,"mean"),nind=117)
     par(mfrow=c(1,1))

     # Recursive highest probability profiles.
     par(mfrow=c(2,2))
     plot(ioprofile(z,"prob"),nind=1)
     plot(ioprofile(z,"prob"),nind=268)
     plot(ioprofile(z,"prob"),nind=c(1,268))
     plot(ioprofile(z,"prob"),nind=117)
     par(mfrow=c(1,1))

     # Recursive predicted profiles.
     par(mfrow=c(2,2))
     plot(ioprofile(z,"both"),nind=120)
     plot(ioprofile(z,"both"),nind=268)
     plot(ioprofile(z,"both"),nind=c(1,117),add=T)
     par(mfrow=c(1,1))

     # Recursive cumulative probability profiles.
     par(mfrow=c(2,2))
     plot(ioprofile(z,"cum"),nind=1)
     plot(ioprofile(z,"cum"),nind=268)
     plot(ioprofile(z,"cum"),nind=c(117,120),add=T)
     par(mfrow=c(1,1))

     rm(w,z)

