<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="FeedCreator 1.8" -->
<?xml-stylesheet href="https://nd.psychstat.org/lib/exe/css.php?s=feed" type="text/css"?>
<rdf:RDF
    xmlns="http://purl.org/rss/1.0/"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
    xmlns:dc="http://purl.org/dc/elements/1.1/">
    <channel rdf:about="https://nd.psychstat.org/feed.php">
        <title>@ND - lab:zhang</title>
        <description></description>
        <link>https://nd.psychstat.org/</link>
        <image rdf:resource="https://nd.psychstat.org/_media/wiki/dokuwiki.svg" />
       <dc:date>2026-04-15T03:58:49+00:00</dc:date>
        <items>
            <rdf:Seq>
                <rdf:li rdf:resource="https://nd.psychstat.org/lab/zhang/an_r_function_to_run_mplus_and_obtain_bc_intervals"/>
                <rdf:li rdf:resource="https://nd.psychstat.org/lab/zhang/bayesian_exploratory_factor_analysis_using_informative_priors"/>
                <rdf:li rdf:resource="https://nd.psychstat.org/lab/zhang/bmem_simulation_setup_using_r"/>
                <rdf:li rdf:resource="https://nd.psychstat.org/lab/zhang/classes"/>
                <rdf:li rdf:resource="https://nd.psychstat.org/lab/zhang/dynamic_mediation_analysis_with_sam"/>
                <rdf:li rdf:resource="https://nd.psychstat.org/lab/zhang/fiml-mnar-0.1"/>
                <rdf:li rdf:resource="https://nd.psychstat.org/lab/zhang/fiml-mnar-0.2"/>
                <rdf:li rdf:resource="https://nd.psychstat.org/lab/zhang/fiml-mnar-0.4"/>
                <rdf:li rdf:resource="https://nd.psychstat.org/lab/zhang/generate_complete_data_for_linear_model"/>
                <rdf:li rdf:resource="https://nd.psychstat.org/lab/zhang/growth_curve_modeling_with_mnar_data"/>
                <rdf:li rdf:resource="https://nd.psychstat.org/lab/zhang/individual_probability_in_mixture_model"/>
                <rdf:li rdf:resource="https://nd.psychstat.org/lab/zhang/missing_data_mediation_analysis"/>
                <rdf:li rdf:resource="https://nd.psychstat.org/lab/zhang/paperreviewed"/>
                <rdf:li rdf:resource="https://nd.psychstat.org/lab/zhang/plot_running_time_for_bmem"/>
                <rdf:li rdf:resource="https://nd.psychstat.org/lab/zhang/power_analysis_with_timo_manuel"/>
                <rdf:li rdf:resource="https://nd.psychstat.org/lab/zhang/process_bmem_results_for_bmem_paper"/>
                <rdf:li rdf:resource="https://nd.psychstat.org/lab/zhang/process_the_data_for_analysis_2010-01-25"/>
                <rdf:li rdf:resource="https://nd.psychstat.org/lab/zhang/r_codes_for_plot_of_relative_deviance_according_to_number_of_imputations"/>
                <rdf:li rdf:resource="https://nd.psychstat.org/lab/zhang/r_codes_for_plot_two-sided_q-q_plots"/>
                <rdf:li rdf:resource="https://nd.psychstat.org/lab/zhang/r_codes_for_processing_results_from_mplus"/>
                <rdf:li rdf:resource="https://nd.psychstat.org/lab/zhang/r_codes_for_processing_results_of_mi_using_sas"/>
                <rdf:li rdf:resource="https://nd.psychstat.org/lab/zhang/r_codes_for_running_mi_simulation"/>
                <rdf:li rdf:resource="https://nd.psychstat.org/lab/zhang/r_codes_for_running_mplus_for_simulation"/>
                <rdf:li rdf:resource="https://nd.psychstat.org/lab/zhang/r_codes_for_running_the_listwise_deletion_simulation"/>
                <rdf:li rdf:resource="https://nd.psychstat.org/lab/zhang/r_codes_for_running_the_pairwise_deletion_simulation"/>
                <rdf:li rdf:resource="https://nd.psychstat.org/lab/zhang/r-mplus-mnar-simulation"/>
                <rdf:li rdf:resource="https://nd.psychstat.org/lab/zhang/robust_growth_curve_modeling_using_student-t_distribution"/>
                <rdf:li rdf:resource="https://nd.psychstat.org/lab/zhang/robust_mediation_analysis"/>
                <rdf:li rdf:resource="https://nd.psychstat.org/lab/zhang/run_bmeme_in_r_for_simulation"/>
                <rdf:li rdf:resource="https://nd.psychstat.org/lab/zhang/sas_macros_for_listwise_deletion"/>
                <rdf:li rdf:resource="https://nd.psychstat.org/lab/zhang/sas_macros_for_pairwise_deletion"/>
                <rdf:li rdf:resource="https://nd.psychstat.org/lab/zhang/sas_macros_for_simulation"/>
                <rdf:li rdf:resource="https://nd.psychstat.org/lab/zhang/simulation_codes_on_2010-10-25"/>
                <rdf:li rdf:resource="https://nd.psychstat.org/lab/zhang/stars_plot_for_result_comparison"/>
                <rdf:li rdf:resource="https://nd.psychstat.org/lab/zhang/todo"/>
                <rdf:li rdf:resource="https://nd.psychstat.org/lab/zhang/wainer_analysis"/>
            </rdf:Seq>
        </items>
    </channel>
    <image rdf:about="https://nd.psychstat.org/_media/wiki/dokuwiki.svg">
        <title>@ND</title>
        <link>https://nd.psychstat.org/</link>
        <url>https://nd.psychstat.org/_media/wiki/dokuwiki.svg</url>
    </image>
    <item rdf:about="https://nd.psychstat.org/lab/zhang/an_r_function_to_run_mplus_and_obtain_bc_intervals">
        <dc:format>text/html</dc:format>
        <dc:date>2016-01-24T14:48:26+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>an_r_function_to_run_mplus_and_obtain_bc_intervals</title>
        <link>https://nd.psychstat.org/lab/zhang/an_r_function_to_run_mplus_and_obtain_bc_intervals</link>
        <description>## Program to run Mplus for the simulation

## function to calculate the BC for mplus
bc.ci&lt;-function(res, est){
  iB&lt;-length(res)
  ## BC interval
  alpha&lt;-c(.025, .975)
  z0&lt;-qnorm(sum(res&lt;est)/iB)
  zalpha&lt;-qnorm(alpha)
  bcalpha&lt;-pnorm(2*z0+zalpha)
  BC&lt;-quantile(res,bcalpha)
 
  c(est, sd(res), BC)
}


## run the simulation
## run the bootstrap to get sd, ci for indirect effect
boot.mplus&lt;-function(B, N, datafile, scriptfile, resfile){
  temp.data&lt;-read.table(datafile)
  write.table(temp.da…</description>
    </item>
    <item rdf:about="https://nd.psychstat.org/lab/zhang/bayesian_exploratory_factor_analysis_using_informative_priors">
        <dc:format>text/html</dc:format>
        <dc:date>2016-01-24T14:48:26+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>bayesian_exploratory_factor_analysis_using_informative_priors</title>
        <link>https://nd.psychstat.org/lab/zhang/bayesian_exploratory_factor_analysis_using_informative_priors</link>
        <description>Bayesian exploratory factor analysis using informative priors

Data generation


model{
   for (i in 1:N){
     f[i,1:2]~dmnorm(muf[1:2], pre.phi[1:2,1:2])
     for (j1 in 1:6){
         muy[i,j1]&lt;-l1[j1]*f[i,1]+l2[j1]*f[i,2]
         y[i,j1]~dnorm(muy[i,j1],pre.p[j1])
     }
   }
}
list(N=200, l1=c(.6,.6,.6,0,0,0), l2=c(0,0,0, .6,.6,.6),
muf=c(0,0),
pre.p=c(1.5625,1.5625, 1.5625, 2.78, 2.78, 2.78),
pre.phi=structure(.Data =c(1.33, -0.67, -.67, 1.33), .Dim = c(2,2)))</description>
    </item>
    <item rdf:about="https://nd.psychstat.org/lab/zhang/bmem_simulation_setup_using_r">
        <dc:format>text/html</dc:format>
        <dc:date>2016-01-24T14:48:26+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>bmem_simulation_setup_using_r</title>
        <link>https://nd.psychstat.org/lab/zhang/bmem_simulation_setup_using_r</link>
        <description>pat&lt;-c(&#039;comp&#039;,&#039;mcar&#039;,&#039;mcar0&#039;,&#039;mcar1&#039;,&#039;mcar2&#039;,&#039;mar&#039;,&#039;mar0&#039;,&#039;mar1&#039;,&#039;mar2&#039;,&#039;mnar&#039;,&#039;mnar0&#039;,&#039;mnar1&#039;,&#039;mnar2&#039;,&#039;mnar0-1&#039;,&#039;mnar1-1&#039;,&#039;mnar2-1&#039;)

## create folders
for (mis in pat){
  system(paste(&#039;mkdir &#039;,mis, sep=&#039;&#039;))
  for (i in 1:3){
    system(paste(&#039;mkdir &#039;,mis, &#039;/&#039;, i, sep=&#039;&#039;))
  }
}

## copy bmem to the folders
for (mis in pat){
  for (i in 1:3){
    system(paste(&#039;cp bmem &#039;,mis, &#039;/&#039;, i,&#039;/.&#039;, sep=&#039;&#039;))
  }
}

## generate submit script

pat1&lt;-c(&#039;mcar&#039;,&#039;mar&#039;,&#039;mnar&#039;)

for (mis in pat1){

     filename &lt;…</description>
    </item>
    <item rdf:about="https://nd.psychstat.org/lab/zhang/classes">
        <dc:format>text/html</dc:format>
        <dc:date>2016-01-24T14:48:26+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>classes</title>
        <link>https://nd.psychstat.org/lab/zhang/classes</link>
        <description>*  index

A nice blog on MCMC: &lt;http://theoreticalecology.wordpress.com/2011/12/09/mcmc-chain-analysis-and-convergence-diagnostics-with-coda-in-r/&gt;

A paper

&lt;http://onlinelibrary.wiley.com/doi/10.1111/j.1461-0248.2011.01640.x/pdf&gt;</description>
    </item>
    <item rdf:about="https://nd.psychstat.org/lab/zhang/dynamic_mediation_analysis_with_sam">
        <dc:format>text/html</dc:format>
        <dc:date>2016-01-24T14:48:26+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>dynamic_mediation_analysis_with_sam</title>
        <link>https://nd.psychstat.org/lab/zhang/dynamic_mediation_analysis_with_sam</link>
        <description>Dynamic mediation analysis with Sam

Process the data for analysis 2010-01-25</description>
    </item>
    <item rdf:about="https://nd.psychstat.org/lab/zhang/fiml-mnar-0.1">
        <dc:format>text/html</dc:format>
        <dc:date>2016-01-24T14:48:26+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>fiml-mnar-0.1</title>
        <link>https://nd.psychstat.org/lab/zhang/fiml-mnar-0.1</link>
        <description>1 -0.032 0.1935456 0.062  2 0.07588255 0.3975445 0.205  3 -0.009842634 0.2686099 0.105  4 0.021 0.2611601 0.109  5 -0.012 0.239 0.106  6 0.009 0.216 0.098  7 0.05 0.3628793 0.159  8 0.003 0.23304 0.087  9 0.07 0.3251475 0.164  10 -0.032 0.2302722 0.076</description>
    </item>
    <item rdf:about="https://nd.psychstat.org/lab/zhang/fiml-mnar-0.2">
        <dc:format>text/html</dc:format>
        <dc:date>2016-01-24T14:48:26+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>fiml-mnar-0.2</title>
        <link>https://nd.psychstat.org/lab/zhang/fiml-mnar-0.2</link>
        <description>1 -0.033 0.2582820 0.067  2 0.055 0.404501 0.188  3 -0.02429877 0.2843474 0.1  4 0.028 0.3080503 0.115  5 -0.002234903 0.285089 0.117  6 -0.02 0.2295361 0.08  7 0.045 0.3777618 0.165  8 -0.001 0.2848373 0.088  9 0.069 0.3521732 0.181  10 -0.05345098 0.271 0.084</description>
    </item>
    <item rdf:about="https://nd.psychstat.org/lab/zhang/fiml-mnar-0.4">
        <dc:format>text/html</dc:format>
        <dc:date>2016-01-24T14:48:26+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>fiml-mnar-0.4</title>
        <link>https://nd.psychstat.org/lab/zhang/fiml-mnar-0.4</link>
        <description>1 -0.06645884 0.3172354 0.056  2 -0.056 0.3131110 0.087  3 -0.07701762 0.3269593 0.081  4 -0.01032937 0.3527093 0.149  5 -0.071 0.4015737 0.117  6 -0.1919515 0.1029960 0.001  7 -0.025 0.4826391 0.096  8 -0.029 0.3291485 0.075  9 0.05379908 0.4856425 0.205</description>
    </item>
    <item rdf:about="https://nd.psychstat.org/lab/zhang/generate_complete_data_for_linear_model">
        <dc:format>text/html</dc:format>
        <dc:date>2016-01-24T14:48:26+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>generate_complete_data_for_linear_model</title>
        <link>https://nd.psychstat.org/lab/zhang/generate_complete_data_for_linear_model</link>
        <description>library(mvtnorm)

grm.linear&lt;-function(N, T, R){
## Constants and parameters
mL&lt;-50
vL&lt;-100
mS&lt;-1
vS&lt;-25
vLS&lt;-0
vE&lt;-25

mu&lt;-c(mL,mS)
sigma&lt;-array(c(vL,vLS,vLS,vS), dim=c(2,2))

y&lt;-array(NA, dim=c(N, T))
LS&lt;-array(NA, dim=c(N, 2))

for (i in 1:N){
  LS[i,]&lt;-rmvnorm(1, mu, sigma)
  for (j in 1:T){
    y[i, j] &lt;- LS[i,1] + LS[i,2]*(j-1)/(T-1) + rnorm(1, 0, sqrt(vE))
  }
}

#data.file&lt;-paste(&#039;H:\\Private\\LongPower\\type1\\data\\N-&#039;,N,&#039;-T-&#039;,T,&#039;-&#039;,1000+R,&#039;.txt&#039;,sep=&#039;&#039;)
data.file&lt;-paste(&#039;LS-N-&#039;,N,&#039;-T-…</description>
    </item>
    <item rdf:about="https://nd.psychstat.org/lab/zhang/growth_curve_modeling_with_mnar_data">
        <dc:format>text/html</dc:format>
        <dc:date>2016-01-24T14:48:26+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>growth_curve_modeling_with_mnar_data</title>
        <link>https://nd.psychstat.org/lab/zhang/growth_curve_modeling_with_mnar_data</link>
        <description>Growth curve modeling with MNAR data

An working example


#WinBUGS codes generated by BAUW: http://bauw.psychstat.org
#USE WITH CAUTION!

Model{
  # Model specification for linear growth curve model
  for (i in 1:N){
    LS[i,1:2]~dmnorm(muLS[i,1:2], Inv_cov[1:2,1:2])
    muLS[i,1]&lt;-bL[1]
    muLS[i,2]&lt;-bS[1]
    for (t in 1:5){
      y[i, t] ~ dnorm(muY[i,t], Inv_Sig_e2)
      muY[i,t]&lt;-LS[i,1]+LS[i,2]*t

      ## missing data mechanism
      m[i,t]~dbern(p[i,t])
      p[i,t]&lt;-phi(gam[t,1]+gam…</description>
    </item>
    <item rdf:about="https://nd.psychstat.org/lab/zhang/individual_probability_in_mixture_model">
        <dc:format>text/html</dc:format>
        <dc:date>2016-01-24T14:48:26+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>individual_probability_in_mixture_model</title>
        <link>https://nd.psychstat.org/lab/zhang/individual_probability_in_mixture_model</link>
        <description>## Conjugate priors
model
        {
                for( i in 1 : N ) {
                        y[i] ~ dnorm(mu[Z[i]], pre.phi[Z[i]])
                        Z[i] ~ dcat(lambda[1:2])
                        logp1[i]&lt;-log(lambda[1])-.5*log(2*3.1415926)-.5*log(phi[1])-(y[i]-mu[1])*(y[i]-mu[1])/(2*phi[1])
                        logp2[i]&lt;-log(lambda[2])-.5*log(2*3.1415926)-.5*log(phi[2])-(y[i]-mu[2])*(y[i]-mu[2])/(2*phi[2])
                        p1[i]&lt;-exp(logp1[i])/(exp(logp1[i])+exp(logp2[i]))
…</description>
    </item>
    <item rdf:about="https://nd.psychstat.org/lab/zhang/missing_data_mediation_analysis">
        <dc:format>text/html</dc:format>
        <dc:date>2016-01-24T14:48:26+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>missing_data_mediation_analysis</title>
        <link>https://nd.psychstat.org/lab/zhang/missing_data_mediation_analysis</link>
        <description>Simulation results

[All results in Excel table]

Data simulation

	*  Stars plot for result comparison
	*  Simulation codes on 2010-10-25

Listwise deletion

	*  SAS macros for listwise deletion
	*  R codes for running the listwise deletion simulation

Pairwise deletion

	*  SAS macros for pairwise deletion
	*  R codes for running the pairwise deletion simulation

BMEM

	*  Run BMEME in R for simulation
	*  BMEM simulation setup using R
	*  Process BMEM results for BMEM paper
	*  [Results from …</description>
    </item>
    <item rdf:about="https://nd.psychstat.org/lab/zhang/paperreviewed">
        <dc:format>text/html</dc:format>
        <dc:date>2016-01-24T14:48:26+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>paperreviewed</title>
        <link>https://nd.psychstat.org/lab/zhang/paperreviewed</link>
        <description>2013
 Title   Number  Aging, Neuropsychology and Cognition   2</description>
    </item>
    <item rdf:about="https://nd.psychstat.org/lab/zhang/plot_running_time_for_bmem">
        <dc:format>text/html</dc:format>
        <dc:date>2016-01-24T14:48:26+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>plot_running_time_for_bmem</title>
        <link>https://nd.psychstat.org/lab/zhang/plot_running_time_for_bmem</link>
        <description>y&lt;-array(c(2.05, 4.13, 15, 2.79, 5.03, 16.24, 8.41, 15.34, 50.13, 20.35, 33.37, 125.46), dim=c(3,4))

plot(c(100,200,500,1000),y[1,], ylim=c(0,130), xlab=&#039;Sample size&#039;, ylab=&#039;Time (seconds)&#039;)
lines(c(100,200,500,1000),y[1,])

points(c(100,200,500,1000),y[2,])
lines(c(100,200,500,1000),y[2,],lty=2)

points(c(100,200,500,1000),y[3,])
lines(c(100,200,500,1000),y[3,],lty=3)

## for 10%
text(100, 2.05, &#039;2.05&#039;, pos=1)
text(200, 2.79, &#039;2.79&#039;, pos=1)
text(500, 8.41, &#039;8.41&#039;, pos=1)
text(1000, 20.35, &#039;20.…</description>
    </item>
    <item rdf:about="https://nd.psychstat.org/lab/zhang/power_analysis_with_timo_manuel">
        <dc:format>text/html</dc:format>
        <dc:date>2016-01-24T14:48:26+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>power_analysis_with_timo_manuel</title>
        <link>https://nd.psychstat.org/lab/zhang/power_analysis_with_timo_manuel</link>
        <description>Power analysis

possible journals:

Methodology: &lt;http://www.psycontent.com/content/120235/&gt;

FIML

R-Mplus-MNAR-Simulation

FIML-MNAR-0.1

FIML-MNAR-0.2

FIML-MNAR-0.4

Scripts and codes

	*  R codes for plot two-sided Q-Q plots
	*  Generate complete data for linear model

Output parameter bias in a table



linear.res&lt;-function(filename)
{
##process the results
# res.file&lt;-paste(&#039;res-N&#039;,N,&#039;-T&#039;,T,&#039;-alpha&#039;,alpha,&#039;-R&#039;,r,&#039;-a.txt&#039;,sep=&#039;&#039;)

## filename&lt;-&#039;C:\\zzy\\research\\LongPower\\Results\\MAR\\l…</description>
    </item>
    <item rdf:about="https://nd.psychstat.org/lab/zhang/process_bmem_results_for_bmem_paper">
        <dc:format>text/html</dc:format>
        <dc:date>2016-01-24T14:48:26+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>process_bmem_results_for_bmem_paper</title>
        <link>https://nd.psychstat.org/lab/zhang/process_bmem_results_for_bmem_paper</link>
        <description>res&lt;-read.table(&#039;comp.txt&#039;, fill=T)
res&lt;-res[ !is.na(res[,65]) ,]
res&lt;-res[, 2:65]

## population parameter values
pop&lt;-c(0,0,.39, .39, 0, 1, 1, .1521)

n&lt;-dim(res)[1]

for (i in 1:8){
  temp&lt;-res[, ((i-1)*8+1):(i*8)]
  if (pop[i] ==0){
       bias&lt;-(mean(temp[,1])-pop[i])*100
       }else{
       	bias&lt;-(mean(temp[,1])-pop[i])*100/pop[i]
       	}
  cvg1&lt;-sum(temp[,3]&lt;pop[i] &amp; temp[,4]&gt;pop[i])/n
  pow1&lt;-sum(temp[,3]&gt;0 | temp[,4]&lt;0)/n
  cvg2&lt;-sum(temp[,5]&lt;pop[i] &amp; temp[,6]&gt;pop[i])/n
  pow2&lt;-sum(…</description>
    </item>
    <item rdf:about="https://nd.psychstat.org/lab/zhang/process_the_data_for_analysis_2010-01-25">
        <dc:format>text/html</dc:format>
        <dc:date>2016-01-24T14:48:26+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>process_the_data_for_analysis_2010-01-25</title>
        <link>https://nd.psychstat.org/lab/zhang/process_the_data_for_analysis_2010-01-25</link>
        <description>## add missing data for missing days

## read data
dset&lt;-read.csv(&#039;dynamic-mediation-data-2010-01-25.csv&#039;, head=T)

uniqueid&lt;-unique(dset$X.id)
freqid&lt;-table(dset$X.id)

k&lt;-length(uniqueid)

id&lt;-rep(1:length(uniqueid), freqid)

dset&lt;-cbind(id, dset)

m&lt;-length(uniqueid)*50

## sort the data using id and survey
dset&lt;-dset[order(dset$survey), ]
dset&lt;-dset[order(dset$id), ]

dim(dset)

aug&lt;-NULL

len&lt;-1:50

for (i in 1:k){
	temp&lt;-dset$survey[dset$id==i]
	temp1&lt;-len[-temp]
	temp2&lt;-cbind(rep(i,length…</description>
    </item>
    <item rdf:about="https://nd.psychstat.org/lab/zhang/r_codes_for_plot_of_relative_deviance_according_to_number_of_imputations">
        <dc:format>text/html</dc:format>
        <dc:date>2016-01-24T14:48:26+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>r_codes_for_plot_of_relative_deviance_according_to_number_of_imputations</title>
        <link>https://nd.psychstat.org/lab/zhang/r_codes_for_plot_of_relative_deviance_according_to_number_of_imputations</link>
        <description>dset&lt;-structure(list(V1 = c(100L, 90L, 80L, 70L, 60L, 50L, 40L, 30L, 
20L, 10L), V2 = c(0, 0.003841788, -0.001492275, -0.000219173, 
-0.002724556, 0.00336318, -0.012693059, -0.010003541, -0.006839342, 
-0.020346107), V3 = c(0, 0.001393081, 0.002897879, 0.001972387, 
0.000464792, 0.002782286, 0.002782286, -0.000697999, 0.004973973, 
0.011605194), V4 = c(0, -0.004692156, -0.005776311, -0.027694902, 
-0.012266019, -0.029263698, -0.052509217, -0.083641089, -0.110293602, 
-0.011652035), V5 = c(0, -0.…</description>
    </item>
    <item rdf:about="https://nd.psychstat.org/lab/zhang/r_codes_for_plot_two-sided_q-q_plots">
        <dc:format>text/html</dc:format>
        <dc:date>2016-01-24T14:48:26+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>r_codes_for_plot_two-sided_q-q_plots</title>
        <link>https://nd.psychstat.org/lab/zhang/r_codes_for_plot_two-sided_q-q_plots</link>
        <description>## qqplot for testing the distributions

## for linear model
qq.linear&lt;-function(T, N, r){

T=4
N=300
r=0.1

prob&lt;-seq(.01,.99,.01)

plotname&lt;-paste(&#039;QQ-Linear-&#039;, T, &#039;-N-&#039;, N, &#039;-R-&#039;, r, &#039;.pdf&#039;, sep=&#039;&#039;)

pdf(file=plotname, width=5, height=5)

par(mar=c(5, 4, 4, 5) + 0.1)

## complete data
file.comp&lt;-paste(&#039;C:\\zzy\\LongPower\\Results\\qqplot\\linear-MCAR&#039;,&#039;T-&#039;,T,&#039;-N&#039;,N,&#039;-R&#039;,0,&#039;.txt&#039;,sep=&#039;&#039;)
y.comp&lt;-scan(file.comp)
plot(qchisq(prob, 1), quantile(y.comp, prob=prob), ylim=c(0,7), xlim=c(0,7),type=&#039;l…</description>
    </item>
    <item rdf:about="https://nd.psychstat.org/lab/zhang/r_codes_for_processing_results_from_mplus">
        <dc:format>text/html</dc:format>
        <dc:date>2016-01-24T14:48:26+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>r_codes_for_processing_results_from_mplus</title>
        <link>https://nd.psychstat.org/lab/zhang/r_codes_for_processing_results_from_mplus</link>
        <description>## Process results from Mplus

proc.res&lt;-function(pat, r){
  filename&lt;-paste(pat,&#039;-&#039;,r,&#039;.txt&#039;, sep=&#039;&#039;)
  res&lt;-read.table(filename)
  res&lt;-res[!is.na(res[,8]),]
      iL&lt;-dim(res)[1]
      est&lt;-mean(res[,6])
      bias&lt;-(est-.1521)/.1521

      cvg&lt;-sum( res[,5]&lt;.1521 &amp; res[,7]&gt;.1521 )/iL
      power&lt;-sum(res[,5]&gt;0 | res[,7]&lt;0)/iL
      cat(c(est,bias, cvg,power, iL), &quot;\n&quot;)  

  }

mis.pat&lt;-c(&#039;mcar0&#039;,&#039;mcar1&#039;,&#039;mcar2&#039;,&#039;mar0&#039;,&#039;mar1&#039;,&#039;mar2&#039;,&#039;mnar0&#039;,&#039;mnar1&#039;,&#039;mnar2&#039;,&#039;mnar0-1&#039;,&#039;mnar1-1&#039;,&#039;mnar2-1&#039;)

rate…</description>
    </item>
    <item rdf:about="https://nd.psychstat.org/lab/zhang/r_codes_for_processing_results_of_mi_using_sas">
        <dc:format>text/html</dc:format>
        <dc:date>2016-01-24T14:48:26+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>r_codes_for_processing_results_of_mi_using_sas</title>
        <link>https://nd.psychstat.org/lab/zhang/r_codes_for_processing_results_of_mi_using_sas</link>
        <description>Process all results


## cp result files into one folder
pat&lt;-c(&#039;mcar&#039;,&#039;mcar0&#039;,&#039;mcar1&#039;,&#039;mcar2&#039;,&#039;mar&#039;,&#039;mar0&#039;,&#039;mar1&#039;,&#039;mar2&#039;,&#039;mnar&#039;,&#039;mnar0&#039;,&#039;mnar1&#039;,&#039;mnar2&#039;,&#039;mnar0-1&#039;,&#039;mnar1-1&#039;,&#039;mnar2-1&#039;)

for (mis in pat){
  for (i in 1:3){     
     cmd&lt;-paste(&#039;cp &#039;, mis,&#039;/&#039;,i,&#039;/*.txt results/.&#039;, sep=&#039;&#039;)
     system(cmd)
  }
}


#############################
## function to print the results
proc.res&lt;-function(pat,r){
  filename&lt;-paste(pat,&#039;-&#039;,r,&#039;.txt&#039;, sep=&#039;&#039;)
 
 res&lt;-read.table(filename, fill=T)
 res&lt;-res[ !is.na…</description>
    </item>
    <item rdf:about="https://nd.psychstat.org/lab/zhang/r_codes_for_running_mi_simulation">
        <dc:format>text/html</dc:format>
        <dc:date>2016-01-24T14:48:26+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>r_codes_for_running_mi_simulation</title>
        <link>https://nd.psychstat.org/lab/zhang/r_codes_for_running_mi_simulation</link>
        <description>## R codes for running simulation of pairwise deletion and listwise deletion
for (ab in c(0, .14, .39, .59)){
	for (N in c(50,100,200)){
		for (miss in c(&#039;MCAR&#039;,&#039;MNAR1&#039;, &#039;MNAR2&#039;)){
			for (rate in c(.1,.2,.4) ){
				for (av in c(&#039;av&#039;,&#039;noav&#039;)){
				## folder name
				folder.name&lt;-paste(&#039;ab&#039;,ab,&#039;N&#039;,N,miss,&#039;M&#039;,rate,sep=&#039;&#039;)
				
				## change the folder name in SAS
				repNS&lt;-paste(&quot;sed &#039;s/simucond/&quot;,folder.name,&quot;/g&#039; mi.sas &gt; temp.sas&quot;,sep=&#039;&#039;)
              system(repNS)
              repNS&lt;-paste(&quot;…</description>
    </item>
    <item rdf:about="https://nd.psychstat.org/lab/zhang/r_codes_for_running_mplus_for_simulation">
        <dc:format>text/html</dc:format>
        <dc:date>2016-01-24T14:48:26+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>r_codes_for_running_mplus_for_simulation</title>
        <link>https://nd.psychstat.org/lab/zhang/r_codes_for_running_mplus_for_simulation</link>
        <description>*  For data without auxiliary variables


## Program to run Mplus for the simulation

## write the model

gen.model&lt;-function(datafile){
## generate mplus scripts for data analysis
## Mplus input scripts
mplus.null&lt;-&#039;model.inp&#039;

## for null model
cat(&#039;TITLE: Model\n&#039;,file=mplus.null); 
cat(&#039;DATA:\n&#039;,file=mplus.null, append=T); 
cat(&#039;  FILE=&#039;, datafile, &#039;;\n&#039;,file=mplus.null, append=T); 
cat(&#039;VARIABLE: \n&#039;,file=mplus.null, append=T); 

cat(&#039;    NAMES ARE X M Y;\n&#039;, file=mplus.null, append=T);

ca…</description>
    </item>
    <item rdf:about="https://nd.psychstat.org/lab/zhang/r_codes_for_running_the_listwise_deletion_simulation">
        <dc:format>text/html</dc:format>
        <dc:date>2016-01-24T14:48:26+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>r_codes_for_running_the_listwise_deletion_simulation</title>
        <link>https://nd.psychstat.org/lab/zhang/r_codes_for_running_the_listwise_deletion_simulation</link>
        <description>## R codes for running simulation of pairwise deletion and listwise deletion
for (ab in c(0, .14, .39, .59)){
	for (N in c(50,100,200)){
		for (miss in c(&#039;MCAR&#039;,&#039;MNAR1&#039;, &#039;MNAR2&#039;)){
			for (rate in c(.1,.2,.4) ){
				## folder name
				folder.name&lt;-paste(&#039;ab&#039;,ab,&#039;N&#039;,N,miss,&#039;M&#039;,rate,sep=&#039;&#039;)
				## change the folder name in SAS
				repNS&lt;-paste(&quot;sed &#039;s/simucond/&quot;,folder.name,&quot;/g&#039; listwise.sas &gt; sasmodel.sas&quot;,sep=&#039;&#039;)
              system(repNS)
              ## Run SAS for simulation
              s…</description>
    </item>
    <item rdf:about="https://nd.psychstat.org/lab/zhang/r_codes_for_running_the_pairwise_deletion_simulation">
        <dc:format>text/html</dc:format>
        <dc:date>2016-01-24T14:48:26+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>r_codes_for_running_the_pairwise_deletion_simulation</title>
        <link>https://nd.psychstat.org/lab/zhang/r_codes_for_running_the_pairwise_deletion_simulation</link>
        <description>## R codes for running simulation of pairwise deletion and listwise deletion
for (ab in c(0, .14, .39, .59)){
	for (N in c(50,100,200)){
		for (miss in c(&#039;MCAR&#039;,&#039;MNAR1&#039;, &#039;MNAR2&#039;)){
			for (rate in c(.1,.2,.4) ){
				## folder name
				folder.name&lt;-paste(&#039;ab&#039;,ab,&#039;N&#039;,N,miss,&#039;M&#039;,rate,sep=&#039;&#039;)
				## change the folder name in SAS
				repNS&lt;-paste(&quot;sed &#039;s/simucond/&quot;,folder.name,&quot;/g&#039; pairwise.sas &gt; sasmodel.sas&quot;,sep=&#039;&#039;)
              system(repNS)
              ## Run SAS for simulation
              s…</description>
    </item>
    <item rdf:about="https://nd.psychstat.org/lab/zhang/r-mplus-mnar-simulation">
        <dc:format>text/html</dc:format>
        <dc:date>2016-01-24T14:48:26+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>r-mplus-mnar-simulation</title>
        <link>https://nd.psychstat.org/lab/zhang/r-mplus-mnar-simulation</link>
        <description>## Program to run Mplus for the simulation

## write the model

gen.model&lt;-function( ){
## generate mplus scripts for data analysis
## Mplus input scripts
mplus.null&lt;-&#039;model.inp&#039;

## for null model
cat(&#039;TITLE: Model\n&#039;,file=mplus.null); 
cat(&#039;DATA:\n&#039;,file=mplus.null, append=T); 
cat(&#039;  FILE=data.txt;\n&#039;,file=mplus.null, append=T); 
cat(&#039;VARIABLE: \n&#039;,file=mplus.null, append=T); 
cat(&#039;    NAMES ARE X M Y U V W;\n&#039;, file=mplus.null, append=T);
cat(&#039;    USEVARIABLES ARE X M Y;\n&#039;, file=mplus.null,…</description>
    </item>
    <item rdf:about="https://nd.psychstat.org/lab/zhang/robust_growth_curve_modeling_using_student-t_distribution">
        <dc:format>text/html</dc:format>
        <dc:date>2016-01-24T14:48:26+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>robust_growth_curve_modeling_using_student-t_distribution</title>
        <link>https://nd.psychstat.org/lab/zhang/robust_growth_curve_modeling_using_student-t_distribution</link>
        <description>Data generation


#WinBUGS codes generated by BAUW: http://bauw.psychstat.org
#USE WITH CAUTION!

Model{
  # Model specification for linear growth curve model
  for (i in 1:N){
    LS[i,1:2]~dmnorm(muLS[i,1:2], Inv_cov[1:2,1:2])
    muLS[i,1]&lt;-bL[1]
    muLS[i,2]&lt;-bS[1]
    for (t in 1:5){
      y[i, t] ~ dt(muY[i,t], Inv_Sig_e2, 4)
      muY[i,t]&lt;-LS[i,1]+LS[i,2]*t
    }
  }

}

# The (naive) starting values for model parameters.
list(bL=c(5), bS = c(2), Inv_Sig_e2 = 1, Inv_cov= structure(.Data…</description>
    </item>
    <item rdf:about="https://nd.psychstat.org/lab/zhang/robust_mediation_analysis">
        <dc:format>text/html</dc:format>
        <dc:date>2016-01-24T14:48:26+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>robust_mediation_analysis</title>
        <link>https://nd.psychstat.org/lab/zhang/robust_mediation_analysis</link>
        <description>Robust mediation analysis

WinBUGS codes

	*  [Normal data]
   mean  sd  MC_error  val2.5pc  median  val97.5pc  start  sample  Para[1]  -0.8407  0.1289  0.005785  -1.091  -0.8418  -0.5905  10001  110000  Para[2]  0.2783  0.01888  4.56E-04  0.2411  0.2783  0.3151</description>
    </item>
    <item rdf:about="https://nd.psychstat.org/lab/zhang/run_bmeme_in_r_for_simulation">
        <dc:format>text/html</dc:format>
        <dc:date>2016-01-24T14:48:26+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>run_bmeme_in_r_for_simulation</title>
        <link>https://nd.psychstat.org/lab/zhang/run_bmeme_in_r_for_simulation</link>
        <description>## run BMEM for mediation analysis

## generate batch file

gen.batch&lt;-function(datafile){
 filename&lt;-&#039;batch.txt&#039;
 cat(&quot;out.txt\n&quot;, file=filename)
 cat(datafile, file=filename, append=T)
 cat(&quot;\n&quot;, file=filename, append=T)
 cat(&quot;99999\n&quot;, file=filename, append=T)
 cat(&quot;.95\n&quot;, file=filename, append=T)  
 cat(runif(1), file=filename, append=T)
 cat(&quot;\n&quot;, file=filename, append=T)
 cat(&quot;1000\n&quot;, file=filename, append=T)
}


runone&lt;-function(datafile, resfile){
    for (i in 1001:2000){
    	  file&lt;…</description>
    </item>
    <item rdf:about="https://nd.psychstat.org/lab/zhang/sas_macros_for_listwise_deletion">
        <dc:format>text/html</dc:format>
        <dc:date>2016-01-24T14:48:26+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>sas_macros_for_listwise_deletion</title>
        <link>https://nd.psychstat.org/lab/zhang/sas_macros_for_listwise_deletion</link>
        <description>/*** Setup the global parameters ***/
/*The parameters below should be changed accordingly*/
*%LET filename=&quot;c:\zzy\mnarmediation\active1.txt&quot;; * data file directory and name;
%LET varname=x m y;  *specify variable names in the data file. Please 
use x for the input variable, m for the mediation variable, and y for 
the output variable. a1 and a2 are two auxiliary variables in the data 
file. You can use any names except for x, m, and y for naming the 
auxiliary variables;
%LET missing=99999; *s…</description>
    </item>
    <item rdf:about="https://nd.psychstat.org/lab/zhang/sas_macros_for_pairwise_deletion">
        <dc:format>text/html</dc:format>
        <dc:date>2016-01-24T14:48:26+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>sas_macros_for_pairwise_deletion</title>
        <link>https://nd.psychstat.org/lab/zhang/sas_macros_for_pairwise_deletion</link>
        <description>/*** Setup the global parameters ***/
/*The parameters below should be changed accordingly*/
*%LET filename=&quot;c:\zzy\mnarmediation\active1.txt&quot;; * data file directory and name;
%LET varname=x m y;  *specify variable names in the data file. Please 
use x for the input variable, m for the mediation variable, and y for 
the output variable. a1 and a2 are two auxiliary variables in the data 
file. You can use any names except for x, m, and y for naming the 
auxiliary variables;
%LET missing=99999; *s…</description>
    </item>
    <item rdf:about="https://nd.psychstat.org/lab/zhang/sas_macros_for_simulation">
        <dc:format>text/html</dc:format>
        <dc:date>2016-01-24T14:48:26+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>sas_macros_for_simulation</title>
        <link>https://nd.psychstat.org/lab/zhang/sas_macros_for_simulation</link>
        <description>/*** Setup the global parameters ***/
/*The parameters below should be changed accordingly*/
*%LET filename=&quot;c:\zzy\mnarmediation\active1.txt&quot;; * data file directory and name;
%LET varname=var00list;  *specify variable names in the data file. Please 
use x for the input variable, m for the mediation variable, and y for 
the output variable. a1 and a2 are two auxiliary variables in the data 
file. You can use any names except for x, m, and y for naming the 
auxiliary variables;
%LET missing=99999…</description>
    </item>
    <item rdf:about="https://nd.psychstat.org/lab/zhang/simulation_codes_on_2010-10-25">
        <dc:format>text/html</dc:format>
        <dc:date>2016-01-24T14:48:26+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>simulation_codes_on_2010-10-25</title>
        <link>https://nd.psychstat.org/lab/zhang/simulation_codes_on_2010-10-25</link>
        <description>normal data


R&lt;-1000
pc&lt;-0

pmu1&lt;-0
pmu2&lt;-0

pS1&lt;-1
pS2&lt;-1

pSX&lt;-1
rho&lt;-.5

sm&lt;-1.1521
sy&lt;-1.175234

set.seed(20100402)
  dir.create(&#039;compdata&#039;)
for (r in 1:R){
for (ab in c(0, .14, .39, .59)){
	pa&lt;-ab
	pb&lt;-ab
	## Generate complete data
    X&lt;-rnorm(500)
  M&lt;-pmu1+pa*X+rnorm(500)
  Y&lt;-pmu2+pb*M+pc*X+rnorm(500)	
	rho&lt;-.5
  ## auxiliary data
  by&lt;-sqrt(rho^2/(1-rho^2)/sy)
  bm&lt;-sqrt(rho^2/(1-rho^2)/sm)
  V&lt;-bm*M+rnorm(500)
  W&lt;-by*Y+rnorm(500)
      
  ## all data together
  dset&lt;-cbind(X, M, Y, …</description>
    </item>
    <item rdf:about="https://nd.psychstat.org/lab/zhang/stars_plot_for_result_comparison">
        <dc:format>text/html</dc:format>
        <dc:date>2016-01-24T14:48:26+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>stars_plot_for_result_comparison</title>
        <link>https://nd.psychstat.org/lab/zhang/stars_plot_for_result_comparison</link>
        <description>facedata&lt;-read.table(&#039;facedata.txt&#039;)



names(facedata)&lt;-c(&#039;B10%&#039;, &#039;B20%&#039;,&#039;B40%&#039;,&#039;C10%&#039;,&#039;C20%&#039;,&#039;C40%&#039;,&#039;P10%&#039;,&#039;P20%&#039;,&#039;P40%&#039;)


stars(facedata,ncol=6, lwd=2, key.loc=c(4,4))

stars(facedata,ncol=6, lwd=2, key.loc=c(8,-1), axes=T, labels=labels)

lines(c(2,6), c(9,9))
text(4.1,9.2,&#039;Without Auxiliary variables&#039;)

lines(c(8.5,13), c(9,9))
text(10.6,9.2,&#039;With Auxiliary variables&#039;)

text(2,7.5,&#039;MI&#039;)

labels&lt;-c(&#039;MCAR/MI&#039;,&#039;MCAR/FIML&#039;,&#039;MCAR/EM&#039;,&#039;MCAR/MI&#039;,&#039;MCAR/FIML&#039;,&#039;MCAR/EM&#039;,&#039;MAR/MI&#039;,&#039;MAR/FIML&#039;,&#039;MAR/EM&#039;,…</description>
    </item>
    <item rdf:about="https://nd.psychstat.org/lab/zhang/todo">
        <dc:format>text/html</dc:format>
        <dc:date>2016-01-24T14:48:26+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>todo</title>
        <link>https://nd.psychstat.org/lab/zhang/todo</link>
        <description>Tasks to be finished

From Beliefs to Virtuous Behaviors

SUBMISSION WINDOW: AUGUST 1 - OCTOBER 15

	*  more information
	*  Process

Monday, Sep 6

&lt;todo&gt;Finish the religious data analysis&lt;/todo&gt;

Friday, Sep 2

&lt;todo #&gt;Lab meeting&lt;/todo&gt;

&lt;todo #&gt;Analyze religious data&lt;/todo&gt;</description>
    </item>
    <item rdf:about="https://nd.psychstat.org/lab/zhang/wainer_analysis">
        <dc:format>text/html</dc:format>
        <dc:date>2016-01-24T14:48:26+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>wainer_analysis</title>
        <link>https://nd.psychstat.org/lab/zhang/wainer_analysis</link>
        <description>#WinBUGS codes generated by BAUW: http://bauw.psychstat.org
#USE WITH CAUTION!

Model{
  # Model specification for 1PL item response model
  for (i in 1:N){
    for (j in 1:20){
      y[i, j] ~ dcat(p[i,j,1:4])
     p[i,j, 1] &lt;-q[i,j,1]
     q[i,j, 1] &lt;-phi(tau[j,1]- (theta[i] - beta[j])*alpha[j])
     q[i,j, 2] &lt;-phi(tau[j,2]- (theta[i] - beta[j])*alpha[j])
     q[i,j, 3] &lt;-phi(tau[j,3]- (theta[i] - beta[j])*alpha[j])
     p[i,j,2]&lt;-q[i,j,2]-q[i,j,1]
     p[i,j,3]&lt;-q[i,j,3]-q[i,j,2]
     p[i,j,…</description>
    </item>
</rdf:RDF>
