Skip to contents

make_projection() outputs the agent or symbolic network corresponding to a survey, i.e. the row or column projection.

Usage

make_projection(
  data,
  layer = NULL,
  method = NULL,
  methodval = NULL,
  comparisons = NULL,
  metric = NULL,
  limits = NULL,
  dummycode = NULL,
  bootreps = NULL,
  bootval = NULL,
  bootseed = NULL,
  centre = NULL,
  ...
)

Arguments

data

A data frame corresponding to a survey

layer

A string flag specifying which layer to project

  • "agent" produces the network corresponding to the agents, which we assume to be rows in data

  • "symbolic" produces the network corresponding to the symbols, or items, which we assume to be columns in data

method

A string flag specifying how edges are thresholded in the network representation.

  • "similarity" means we remove all edges whose weight, meaning node similarity, is below a threshold specified by methodval.

  • "lcc" finds the value of the threshold that results in the network whose largest connected component is as close as possible to a specified value. In general a range of thresholds will satisfy this condition, and we choose the upper limit of this range. As such, "lcc" provided is a target.

  • "avgdegree" finds the value of the threshold that results in the network whose average degree is as close as possible to a specified value. Like "lcc", this is a target.

methodval

A utility variable that we interpret according to the method chosen.

  • If method = "similarity", then methodval is interpreted as the similarity threshold, and thus is in the range [0, 1]. A value of 0 means no edges are removed, and a value of 1 means all edges are removed.

  • If method = "lcc", then methodval is interpreted as the desired fractional size of the largest connected component, in the range [0, 1]. E.g., when set to 0, no nodes are connected, and if set to 1, the network is as sparse as possible while remaining fully connected.

  • If method = "avgdegree", then methodval is interpreted as the desired average degree. We assume that methodval is normalised to the range [0, 1] When method_value = 0, then no nodes are connected, and if method_value = 1, the network is complete, meaning it contains every possible edge.

comparisons

The minimum number of valid comparisons that must be made when computing the similarity between rows or columns in the data. If at least one of the entries in the fields being compared is NA, then the comparison is invalid.

metric

This currently has just one allowed value, namely the Manhattan distance, which is the default.

limits

Specifies the limits of the Likert scale contained in data.

dummycode

flag that indicates whether we dummycode data.

bootreps

The number of bootstrap realisations to perform. If not specified, bootstrapping is not carried out.

bootval

A sampling probability used when bootstraping. In particular, it provides the probability of sampling a given survey entry in a given bootstrapping step. With probability 1 - bootval, that entry is set to NA.

bootseed

A random number generator seed used when bootstrapping. Mainly used for testing, but maybe useful for reproducibility in general.

centre

If TRUE, we shift edge weights from [0, 1] to [-1, 1]. Defaults to FALSE, as most network analysis applications require positive edge weights.

...

Mostly used to handle deprecated arguments, and arguments with alternative spellings.

Value

A data frame corresponding to the edge list of the specified network. It contains three columns named

  • u, the first node adjacent to the edge

  • v, the second node adjacent to the edge, and

  • weight, the similarity between nodes u and v

Examples

S <- make_synthetic_data(20, 5)