| Title: | Network Representations of Attitudes |
| Version: | 1.0.0 |
| Author: | Samuel Unicomb [aut, cre], Ana Jovancevic [aut], Caoimhe O'Reilly [aut], Alejandro Dinkelberg [aut], Pádraig MacCarron [aut], David O'Sullivan [aut], Paul Maher [aut], Mike Quayle [aut] |
| Maintainer: | Samuel Unicomb <samuelunicomb@gmail.com> |
| Description: | A tool for computing network representations of attitudes, extracted from tabular data such as sociological surveys. Development of surveygraph software and training materials was initially funded by the European Union under the ERC Proof-of-concept programme (ERC, Attitude-Maps-4-All, project number: 101069264). Views and opinions expressed are however those of the author(s) only and do not necessarily reflect those of the European Union or the European Research Council Executive Agency. Neither the European Union nor the granting authority can be held responsible for them. |
| Depends: | R (≥ 2.15.1) |
| URL: | https://github.com/surveygraph/surveygraphr, https://surveygraph.ie/ |
| BugReports: | https://github.com/surveygraph/surveygraphr/issues |
| License: | MIT + file LICENSE |
| Encoding: | UTF-8 |
| RoxygenNote: | 7.3.2 |
| Suggests: | covr, knitr, rmarkdown, testthat (≥ 3.0.0) |
| VignetteBuilder: | knitr |
| NeedsCompilation: | yes |
| Packaged: | 2025-11-09 22:09:55 UTC; samuelunicomb |
| Repository: | CRAN |
| Date/Publication: | 2025-11-09 22:20:02 UTC |
surveygraph: network representations of attitudes
Description
This page is a work in progress.
Details
The surveygraph package functions can be summarised as follows.
reading functions
The reading functions import survey datasets to R so they can be passed to C++ routines. A bunch of file formats need to be accounted for.
network generating functions
The network functions are implemented in C++.
Author(s)
Maintainer: Samuel Unicomb samuelunicomb@gmail.com
Authors:
Ana Jovancevic
Caoimhe O'Reilly
Alejandro Dinkelberg
Pádraig MacCarron
David O'Sullivan
Paul Maher
Mike Quayle
See Also
Useful links:
Report bugs at https://github.com/surveygraph/surveygraphr/issues
Outputs a synthetic survey using a simple model
Description
data_preprocess() outputs a synthetic survey, generated using a simple, stochastic
model of polarisation.
Usage
data_preprocess(data, limits = NULL, dummycode = NULL)
Arguments
data |
The number of rows in the survey |
limits |
The number of columns in the survey |
dummycode |
The fraction of nodes in the smaller of the two polarised groups |
Value
A data frame corresponding to a survey.
Examples
S <- make_synthetic_data(200, 8)
Outputs the survey projection onto the agent or symbolic layer
Description
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
|
method |
A string flag specifying how edges are thresholded in the network representation.
|
methodval |
A utility variable that we interpret according to the
|
comparisons |
The minimum number of valid comparisons that must be
made when computing the similarity between rows or columns in the |
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 |
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 |
... |
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 nodesuandv
Examples
S <- make_synthetic_data(20, 5)
Outputs a synthetic survey using a simple model
Description
make_synthetic_data() outputs a synthetic survey, generated using a simple, stochastic
model of polarisation.
Usage
make_synthetic_data(
nrow,
ncol,
minority = NULL,
correlation = NULL,
polarisation = NULL,
likert = NULL,
seed = NULL,
...
)
Arguments
nrow |
The number of rows in the survey |
ncol |
The number of columns in the survey |
minority |
The fraction of nodes in the smaller of the two polarised groups |
correlation |
Probability that group item corresponds to polarisation |
polarisation |
The degree of polarisation among the system's agents |
likert |
Range of the Likert scale |
seed |
Seed value for random number generation. |
... |
Mostly used to handle arguments with alternative spellings. |
Value
A data frame corresponding to a survey.
Examples
S <- make_synthetic_data(200, 8)
Illustrates how network properties vary with the similarity threshold
Description
make_threshold_profile() outputs properties of the agent or symbolic network
as a function of similarity threshold.
Usage
make_threshold_profile(
data,
layer = NULL,
comparisons = NULL,
metric = NULL,
count = NULL,
limits = NULL,
dummycode = NULL,
...
)
Arguments
data |
A data frame corresponding to the attitudes held by agents with respect to a number of items |
layer |
A string flag specifying the type of network to be extracted,
|
comparisons |
An integer, minimum number of comparisons for valid distance. |
metric |
A string option describing the similarity metric to be used. |
count |
The number of threshold values to include in the description. |
limits |
Specify the limits of the Likert range in during a data preprocessing step. |
dummycode |
Specify whether to apply dummycoding during a data preprocessing step. |
... |
Used to handle alternative argument spellings. |
Details
Note that this routine is expensive on large graphs. We study networks over the
full range of similarity thresholds [-1, 1], and as a result, produce
networks that are complete at the lower limit of that range. Note that by default we
will subsample the provided survey with the C++ implementation in order to
avoid memory issues. We could then allow a flag that turns off the subsampling
step, at the user's peril.
Value
A data frame containing properties of the agent or symbolic network as a
function of the similarity threshold. In particular, it contains three columns
named
-
threshold, the value of the similarity threshold -
ad, the average degree resulting fromthreshold, and -
lcc, the size of the largest connected component resulting fromthreshold
Examples
S <- make_synthetic_data(20, 5)