Learn R Programming

amen (version 1.0)

rZ_nrm_fc: Simulate missing values in a normal AME model

Description

Simulates missing values of a sociomatrix under a normal AME model

Usage

rZ_nrm_fc(Z, EZ, rho,s2, Y)

Arguments

Z
a square matrix, the current value of Z
EZ
expected value of Z
rho
dyadic correlation
s2
dyadic variance
Y
square relational matrix

Value

  • a square matrix, equal to Y at non-missing values

Examples

Run this code
## The function is currently defined as
rZ_nrm_fc<-function(Z,EZ,rho,s2,Y)
{
  ZS<-simY_nrm(EZ,rho,s2)
  diag(ZS)<-rnorm(nrow(Y),diag(EZ),sqrt(s2))
  Z[is.na(Y)]<-ZS[is.na(Y)]
  Z
}

Run the code above in your browser using DataLab