-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathREADME.Rmd
More file actions
39 lines (32 loc) · 1.33 KB
/
README.Rmd
File metadata and controls
39 lines (32 loc) · 1.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
---
title: "README"
output: github_document
---
# ProcessResults
A package with some key functions for processing statistical modelling results
## Plotting ERGM Results
The `ERGM_result_plot` function allows you to visualise/plot the results from an ERGM (from `ergm` package output)
### Example - Run ERGM
First we run an ERGM on example data
```{r ergm, eval=TRUE,echo=TRUE,message=FALSE,error=FALSE,warning=FALSE,cache=TRUE}
library(ergm)
data('sampson')
model <- ergm(samplike ~ edges + mutual + nodematch('group') +
gwesp(decay = .5, fixed = TRUE) +
gwidegree(decay = 1, fixed = TRUE))
library(texreg)
screenreg(model,digits=3)
```
### Plot Results
We can now create the plot
```{r ergm_plot,echo=TRUE,message=FALSE,error=FALSE,warning=FALSE,cache=TRUE}
library(ProcessResults)
var_names<-c("Edges","Mutual","Group.Match","GWESP","Indegree")
ERGM_result_plot(model,var_names,plot_title = "Example ERGM Results") #Default is with y axis labels
```
We can also plot this without the y-axis labels, which is useful for panel plots of results with the same coefficients
```{r ergm_plot2,echo=TRUE,message=FALSE,error=FALSE,warning=FALSE,cache=TRUE}
library(ProcessResults)
var_names<-c("Edges","Mutual","Group.Match","GWESP","Indegree")
ERGM_result_plot(model,var_names,plot_title = "Example ERGM Results",y_axis_lab = FALSE)
```