Title: | Draws Diagrams Useful for Checking Latent Scales |
---|---|
Description: | A graph proposed by Rosenbaum is useful for checking some properties of various sorts of latent scale, this program generates commands to obtain the graph using 'dot' from 'graphviz'. |
Authors: | Michael Dewey [aut, cre]
|
Maintainer: | Michael Dewey <[email protected]> |
License: | GPL-2 |
Version: | 0.3 |
Built: | 2025-01-26 04:25:39 UTC |
Source: | https://github.com/cran/latdiag |
A graph proposed by Rosenbaum is useful for checking some properties of various sorts of latent scale, this program generates commands to obtain the graph using 'dot' from 'graphviz'.
Package: | latdiag |
Type: | Package |
Title: | Draws Diagrams Useful for Checking Latent Scales |
Version: | 0.3 |
Date: | 2020-04-03 |
Authors@R: | person("Michael", "Dewey", role = c("aut", "cre"), email = "[email protected]", comment = c(ORCID = "0000-0002-7522-3677") ) |
Description: | A graph proposed by Rosenbaum is useful for checking some properties of various sorts of latent scale, this program generates commands to obtain the graph using 'dot' from 'graphviz'. |
Imports: | Rdpack |
Suggests: | ltm |
RdMacros: | Rdpack |
License: | GPL-2 |
LazyLoad: | yes |
SystemRequirements: | dot from graphviz |
NeedsCompilation: | no |
Packaged: | 2020-04-06 14:33:12 UTC; MichaelUser |
Author: | Michael Dewey [aut, cre] (<https://orcid.org/0000-0002-7522-3677>) |
Maintainer: | Michael Dewey <[email protected]> |
Date/Publication: | 2020-04-06 16:02:06 UTC |
Repository: | https://deweyme.r-universe.dev |
RemoteUrl: | https://github.com/cran/latdiag |
RemoteRef: | HEAD |
RemoteSha: | 23b23256513322accc51bc1f47dee93d27eef1a3 |
Index of help topics:
draw.latent Draw latent scale diagram latdiag-package Draws Diagrams Useful for Checking Latent Scales
Further information is available in the following vignettes:
latdiag |
Drawing diagrams useful for latent scales (source, pdf) |
The package writes a file of commands for subsequent processing by
the dot
program from graphviz
Michael Dewey
Maintainer: Michael Dewey <[email protected]>
Rosenbaum PR (1987). “Probability inequalities for latent scales.” British Journal of Mathematical and Statistical Psychology, 40, 157–168.
Writes a file of commands for the dot program to draw a graph proposed by (Rosenbaum 1987) and useful for checking for non-intersecting item characteristic curves which are a property of various sorts of latent scale including Guttman, Rasch and the Mokken double monotone scale.
draw.latent(mat, threshold = 0, which.npos = NULL, labels = NULL, reorder = TRUE) ## S3 method for class 'draw.latent' print(x, rootname = NULL, ...) ## S3 method for class 'draw.latent' plot(x, rootname = NULL, graphtype = "pdf", ...)
draw.latent(mat, threshold = 0, which.npos = NULL, labels = NULL, reorder = TRUE) ## S3 method for class 'draw.latent' print(x, rootname = NULL, ...) ## S3 method for class 'draw.latent' plot(x, rootname = NULL, graphtype = "pdf", ...)
mat |
A matrix or data.frame of binary item responses |
threshold |
Patterns are only printed if more frequent than threshold, defaults to 0 meaning all those which actually occur are printed |
which.npos |
Which values of number of items positive to print, NULL means all and is the default. Duplicates are removed |
labels |
Labels for subgraphs, NULL means none, a character vector supplies the labels, otherwise labelled as n positive |
reorder |
logical, put the items in ascending order of prevalence, defaults to TRUE |
x |
An object of class |
rootname |
Character: the rootname of the file of dot commands |
graphtype |
Character: one of the graph types supported by |
... |
Other arguments |
The draw.latent
function produces the dot commands
which will draw the graph.
The print
method prints some details.
If rootname
is supplied it will be used as the rootname
of the file of dot commands which will have file type .gv
.
If rootname
is NULL (which is the default) just some details
about the result are printed.
The plot
method actually does the plotting and invisibly
returns the result of the system
command which executes dot
.
The output file will be named with the rootname followed
by the graph type (after a dot).
The routine does not draw the graph itself but leaves that
to the dot
program from graphviz
which you need
to install and have on your path.
More extensive documentation is provided in the vignette.
Returns a list containing:
which.npos |
which values of items positive were printed. Differs from input parameter if for some there were no valid patterns to print or duplicates have been removed |
new.order |
order of original items from left to right in displayed
diagram.
If new.order==TRUE new.order[i] is the index in the original dataset
of the |
code |
a character vector of the dot commands |
The parameter rootname is now supplied to the plot and
print functions and not to draw.latent
Michael Dewey
Rosenbaum PR (1987). “Probability inequalities for latent scales.” British Journal of Mathematical and Statistical Psychology, 40, 157–168.
set.seed(20150114) mat <- cbind( sample(0:1, 100, prob = c(0.2, 0.8), replace = TRUE), sample(0:1, 100, prob = c(0.4, 0.6), replace = TRUE), sample(0:1, 100, prob = c(0.5, 0.5), replace = TRUE), sample(0:1, 100, prob = c(0.6, 0.4), replace = TRUE), sample(0:1, 100, prob = c(0.8, 0.2), replace = TRUE) ) res <- draw.latent(mat) # # now need to plot(res, rootname = "mat", graphtype = "pdf") #
set.seed(20150114) mat <- cbind( sample(0:1, 100, prob = c(0.2, 0.8), replace = TRUE), sample(0:1, 100, prob = c(0.4, 0.6), replace = TRUE), sample(0:1, 100, prob = c(0.5, 0.5), replace = TRUE), sample(0:1, 100, prob = c(0.6, 0.4), replace = TRUE), sample(0:1, 100, prob = c(0.8, 0.2), replace = TRUE) ) res <- draw.latent(mat) # # now need to plot(res, rootname = "mat", graphtype = "pdf") #