Revision dcd2fa6f1994b6500075e0b6f0310a45f112b45f authored by Samrachana Adhikari on 18 June 2014, 00:00:00 UTC, committed by Gabor Csardi on 18 June 2014, 00:00:00 UTC
1 parent 31ec11b
Raw File

\title{built-in plot functions for HLSM object}

 plotLikelihood( ) plots the likelihood, and plotDiagnostic( ) plots diagnostic-plot of posterior draws of the parameters from MCMC sample. ) and ) are functions to plot mean-results from fitted models, and plotHLSM.LS( ) is for plotting the mean latent position estimates.

	plotLikelihood(object,burnin = 0, thin = 1)
	plotDiagnostic(chain),parameter,burnin=0,thin=1), parameter,burnin=0,thin=1)


	\item{object}{object of class 'HLSM' obtained as an output from \code{HLSMrandomEF()} or \code{HLSMfixedEF()}
	\item{fitted.model}{model fit from either HLSMrandomEF() or HLSMfixedEF()}
	\item{parameter}{parameter to plot; specified as \code{Beta} for slope coefficients, \code{Intercept} for intercept, and \code{Theta} for intervention effect}
        \item{burnin}{numeric value to burn the chain for plotting the results from the 'HLSM'object }
	\item{thin}{a numeric thinning value}
	\item{chain}{a numeric vector of posterior draws of parameter of interest.}
	\item{...}{other options}

 returns plot objects.

\author{Sam Adhikari}

#using advice seeking network of teachers in 15 schools
#to fit the data

#Random effect model#
priors = NULL
tune = NULL
initialVals = NULL
niter = 10 = HLSMrandomEF(Y = ps.advice.mat,FullX = ps.edge.vars.mat,
	initialVals = initialVals,priors = priors,
	tune = tune,tuneIn = FALSE,dd = 2,niter = niter,
	intervention = 0)


intercept = getIntercept(
dim(intercept) ##is an array of dimension niter by 15
plotHLSM.LS(,parameter = 'Beta'),parameter = 'Intercept')
##look at the diagnostic plot of intercept for the first school

back to top