plot.lsjm: Two dimensional plot of Latent Space Joint Model output

Description Usage Arguments Examples

Description

Function to plot an object of class 'lsjm'

Usage

1
2
3
4
5
6
## S3 method for class 'lsjm'
plot(x, Y, drawCB = FALSE, dimZ = c(1, 2),
  plotZtilde = FALSE, colPl = 1, colEll = rgb(0.6, 0.6, 0.6, alpha =
  0.1), LEVEL = 0.95, pchplot = 20, pchEll = 19, pchPl = 19,
  cexPl = 1.1, mainZtilde = NULL, arrowhead = FALSE, curve = NULL,
  xlim = NULL, ylim = NULL, main = NULL, ...)

Arguments

x

object of class 'lsjm'

Y

list containing a (N x N) binary adjacency matrix for each network view.

drawCB

logical if drawCB = TRUE draw confidence bounds

dimZ

dimensions of the latent variable to be plotted. Default dimZ = c(1, 2)

plotZtilde

if TRUE do the plot for the last step of LSM

colPl

col for the points representing the nodes. Default colPl = NULL

colEll

col for the ellipses. Default rgb(.6, .6 ,.6 , alpha=.1)

LEVEL

levels of confidence bounds shown when plotting the ellipses. Default LEVEL = .95

pchplot

Default pchplot = 20

pchEll

pch for the ellipses. Default pchEll = 19

pchPl

pch for the points representing the nodes. Default pchPl = 19

cexPl

cex for the points representing the nodes. Default cexPl = 1.1

mainZtilde

title for single network plots TRUE do the plot for the last step of LSM

arrowhead

logical, if the arrowed are to be plotted. Default arrowhead = FALSE

curve

curvature of edges. Default curve = 0

xlim

range for x

ylim

range for y

main

main title

...

Arguments to be passed to methods, such as graphical parameters (see par).

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
## Simulate Undirected Network
  N <- 20
  Ndata <- 2
   Y <- list()
   Y[[1]] <- network(N, directed = FALSE)[,]
   ### create a new view that is similar to the original
  for(nd in 2:Ndata){
    Y[[nd]] <- Y[[nd - 1]] - sample(c(-1, 0, 1), N * N, replace = TRUE, 
    prob = c(.05, .85, .1))
    Y[[nd]] <- 1 * (Y[[nd]]  > 0 )
  diag(Y[[nd]]) <- 0
   }

par(mfrow = c(1, 2))
z <- plotY(Y[[1]], verbose = TRUE, main = 'Network 1')
plotY(Y[[2]], EZ = z, main = 'Network 2')
par(mfrow = c(1, 1))

modLSJM <- lsjm(Y, D = 2) 
plot(modLSJM, Y, drawCB = TRUE)
plot(modLSJM, Y, drawCB = TRUE, plotZtilde = TRUE)

Example output

Loading required package: MASS
Loading required package: ergm
Loading required package: network
network: Classes for Relational Data
Version 1.14-377 created on 2019-03-04.
copyright (c) 2005, Carter T. Butts, University of California-Irvine
                    Mark S. Handcock, University of California -- Los Angeles
                    David R. Hunter, Penn State University
                    Martina Morris, University of Washington
                    Skye Bender-deMoll, University of Washington
 For citation information, type citation("network").
 Type help("network-package") to get started.


ergm: version 3.9.4, created on 2018-08-15
Copyright (c) 2018, Mark S. Handcock, University of California -- Los Angeles
                    David R. Hunter, Penn State University
                    Carter T. Butts, University of California -- Irvine
                    Steven M. Goodreau, University of Washington
                    Pavel N. Krivitsky, University of Wollongong
                    Martina Morris, University of Washington
                    with contributions from
                    Li Wang
                    Kirk Li, University of Washington
                    Skye Bender-deMoll, University of Washington
Based on "statnet" project software (statnet.org).
For license and citation information see statnet.org/attribution
or type citation("ergm").

NOTE: Versions before 3.6.1 had a bug in the implementation of the bd()
constriant which distorted the sampled distribution somewhat. In
addition, Sampson's Monks datasets had mislabeled vertices. See the
NEWS and the documentation for more details.

Loading required package: ellipse

Attaching package: 'ellipse'

The following object is masked from 'package:graphics':

    pairs

lvm4net documentation built on June 13, 2019, 5:03 p.m.