Networks - r assignment

5 important questions on Networks - r assignment

How can you create an unregularized partial correlations network in r?

  • Library(bootnet)
# built a partial correlations network which only shows edges stronger than .1
  • cor_net <- estimateNetwork(data, default = "pcor", threshold = .1)
# make a groups variable that tells the plot function to which questionnaire which variable belongs so it can give matching colours
  • groups <- rep(c("quality of life" , "brief symptom inventory", "Coping strategies"), times = c(6,18,23))
# plot the network groups provides mathcing colours.
  • plot(cor_net, layout = "spring", groups = groups)

How can you build a regularized network model with lasso regularization?


# build the network
lasso_net <- estimateNetwork(qdat, default = "EBICglasso")
# plot the network (the same grouping is used as before)
plot(lasso_net, groups = groups)

How can you have the centrality indices of a network plotted?

Library(qgraph)
centralityPlot(network)
  • Higher grades + faster learning
  • Never study anything twice
  • 100% sure, 100% understanding
Discover Study Smart

How can you assess the stability of the edgeweights in r?


library(bootnet)
# perform a bootstrap on your network
boot1 <- bootnet(network, nBoots = 500, nCores = 4)

# plot the results
plot(boot1, labels = FALSE, order = "sample")
  • The y-axis shows all individual edges.
  • The x-axis shows the strength of the egdes.
  • The black dots are the means for every edge over all bootstrapped samples.
  • The red line shows the values for the edges from the original model.
  • The grey area are the confidence intervals resulted from the bootstrapped samples. The smaller the confidence intervals, the more robust the model is to sampling variation. 

How can you assess whether weights are significantly different from eachother in r?

plot(boot1, "edge", plot = "difference", onlyNonZero = TRUE, order = "sample")
  • This plot shows the edge weights against eachother. It is plotted whether the edge weights significantly differ from eachother in value. The black squares indicate pairs of edges that signficantly differ from eachother while the grey squares indicate pairs of edges that signficantly differ from eachother. There are more grey squares than black squares in this plot which indicates that there are a lot of edges with similar weights.

The question on the page originate from the summary of the following study material:

  • A unique study and practice tool
  • Never study anything twice again
  • Get the grades you hope for
  • 100% sure, 100% understanding
Remember faster, study better. Scientifically proven.
Trustpilot Logo