R JournalPub Date : 2023-11-01DOI: 10.32614/rj-2023-044
Montasser Ghachem, Oguz Ersan
{"title":"PINstimation: An R Package for Estimating Probability of Informed Trading Models","authors":"Montasser Ghachem, Oguz Ersan","doi":"10.32614/rj-2023-044","DOIUrl":"https://doi.org/10.32614/rj-2023-044","url":null,"abstract":"The purpose of this paper is to introduce the R package [PINstimation](https://CRAN.R-project.org/package=PINstimation). The package is designed for fast and accurate estimation of the probability of informed trading models through the implementation of well-established estimation methods. The models covered are the original PIN model [@easley1992time; @easley1996liquidity], the multilayer PIN model [@ersan2016multilayer], the adjusted PIN model [@duarte2009why], and the volume- synchronized PIN [@Easley2011microstructure; @Easley2012Flow]. These core functionalities of the package are supplemented with utilities for data simulation, aggregation and classification tools. In addition to a detailed overview of the package functions, we provide a brief theoretical review of the main methods implemented in the package. Further, we provide examples of use of the package on trade-level data for 58 Swedish stocks, and report straightforward, comparative and intriguing findings on informed trading. These examples aim to highlight the capabilities of the package in tackling relevant research questions and illustrate the wide usage possibilities of PINstimation for both academics and practitioners.","PeriodicalId":51285,"journal":{"name":"R Journal","volume":"108 1-2","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2023-11-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"135714471","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":4,"RegionCategory":"计算机科学","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
R JournalPub Date : 2023-11-01DOI: 10.32614/rj-2023-051
Giuseppe Lamberti,
{"title":"genpathmox: An R Package to Tackle Numerous Categorical Variables and Heterogeneity in Partial Least Squares Structural Equation Modeling","authors":"Giuseppe Lamberti,","doi":"10.32614/rj-2023-051","DOIUrl":"https://doi.org/10.32614/rj-2023-051","url":null,"abstract":"Partial least squares structural equation modeling (PLS-SEM), combined with the analysis of the effects of categorical variables after estimating the model, is a well-established statistical approach to the study of complex relationships between variables. However, the statistical methods and software packages available are limited when we are interested in assessing the effects of several categorical variables and shaping different groups following different models. Following the framework established by @Lamberti16, we have developed the  [genpathmox](https://CRAN.R-project.org/package=genpathmox) *R* package for handling a large number of categorical variables when faced with heterogeneity in PLS-SEM. The package has functions for various aspects of the analysis of heterogeneity in PLS-SEM models, including estimation, visualization, and hypothesis testing. In this paper, we describe the implementation of genpathmox in detail and demonstrate its usefulness by analyzing employee satisfaction data.","PeriodicalId":51285,"journal":{"name":"R Journal","volume":"110 3-6","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2023-11-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"135714464","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":4,"RegionCategory":"计算机科学","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
R JournalPub Date : 2023-11-01DOI: 10.32614/rj-2023-053
Santtu Tikka
{"title":"Identifying Counterfactual Queries with the R Package cfid","authors":"Santtu Tikka","doi":"10.32614/rj-2023-053","DOIUrl":"https://doi.org/10.32614/rj-2023-053","url":null,"abstract":"In the framework of structural causal models, counterfactual queries describe events that concern multiple alternative states of the system under study. Counterfactual queries often take the form of \"what if\" type questions such as \"would an applicant have been hired if they had over 10 years of experience, when in reality they only had 5 years of experience?\" Such questions and counterfactual inference in general are crucial, for example when addressing the problem of fairness in decision-making. Because counterfactual events contain contradictory states of the world, it is impossible to conduct a randomized experiment to address them without making several restrictive assumptions. However, it is sometimes possible to identify such queries from observational and experimental data by representing the system under study as a causal model, and the available data as symbolic probability distributions. @shpitser2007 constructed two algorithms, called ID* and IDC*, for identifying counterfactual queries and conditional counterfactual queries, respectively. These two algorithms are analogous to the ID and IDC algorithms by @shpitser2006id [@shpitser2006idc] for identification of interventional distributions, which were implemented in R by @tikka2017 in the causaleffect package. We present the R package [cfid](https://CRAN.R-project.org/package=cfid) that implements the ID* and IDC* algorithms. Identification of counterfactual queries and the features of cfid are demonstrated via examples.","PeriodicalId":51285,"journal":{"name":"R Journal","volume":"104 1-2","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2023-11-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"135714320","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":4,"RegionCategory":"计算机科学","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
R JournalPub Date : 2023-11-01DOI: 10.32614/rj-2023-042
Prajual Maheshwari, Mohammad Arshad Rahman
{"title":"bqror: An R package for Bayesian Quantile Regression in Ordinal Models","authors":"Prajual Maheshwari, Mohammad Arshad Rahman","doi":"10.32614/rj-2023-042","DOIUrl":"https://doi.org/10.32614/rj-2023-042","url":null,"abstract":"This article describes an R package bqror that estimates Bayesian quantile regression for ordinal models introduced in citet{Rahman-2016}. The paper classifies ordinal models into two types and offers two computationally efficient, yet simple, MCMC algorithms for estimating ordinal quantile regression. The generic ordinal model with more than 3 outcomes (labeled $OR_{I}$ model) is estimated by a combination of Gibbs sampling and Metropolis-Hastings algorithm. Whereas an ordinal model with exactly 3 outcomes (labeled $OR_{II}$ model) is estimated using Gibbs sampling only. In line with the Bayesian literature, we suggest using marginal likelihood for comparing alternative quantile regression models and explain how to calculate the same. The models and their estimation procedures are illustrated via multiple simulation studies and implemented in the two applications presented in citet{Rahman-2016}. The article also describes several other functions contained within the bqror package, which are necessary for estimation, inference, and assessing model fit.","PeriodicalId":51285,"journal":{"name":"R Journal","volume":"32 4","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2023-11-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"136103240","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":4,"RegionCategory":"计算机科学","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
R JournalPub Date : 2023-11-01DOI: 10.32614/rj-2023-054
Alan Inglis, Andrew Parnell, Catherine Hurley
{"title":"vivid: An R package for Variable Importance and Variable Interactions Displays for Machine Learning Models","authors":"Alan Inglis, Andrew Parnell, Catherine Hurley","doi":"10.32614/rj-2023-054","DOIUrl":"https://doi.org/10.32614/rj-2023-054","url":null,"abstract":"We present vivid, an R package for visualizing variable importance and variable interactions in machine learning models. The package provides heatmap and graph-based displays for viewing variable importance and interaction jointly, and partial dependence plots in both a matrix layout and an alternative layout emphasizing important variable subsets. With the intention of increasing machine learning models' interpretability and making the work applicable to a wider readership, we discuss the design choices behind our implementation by focusing on the package structure and providing an in-depth look at the package functions and key features. We also provide a practical illustration of the software in use on a data set.","PeriodicalId":51285,"journal":{"name":"R Journal","volume":"92 3-4","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2023-11-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"135714163","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":4,"RegionCategory":"计算机科学","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
R JournalPub Date : 2023-11-01DOI: 10.32614/rj-2023-046
Paul Harrison
{"title":"langevitour: Smooth Interactive Touring of High Dimensions, Demonstrated with scRNA-Seq Data","authors":"Paul Harrison","doi":"10.32614/rj-2023-046","DOIUrl":"https://doi.org/10.32614/rj-2023-046","url":null,"abstract":"langevitour displays interactive animated 2D projections of high-dimensional datasets. Langevin Dynamics is used to produce a smooth path of projections. Projections are initially explored at random. A \"guide\" can be activated to look for an informative projection, or variables can be manually positioned. After a projection of particular interest has been found, continuing small motions provide a channel of visual information not present in a static scatter plot. langevitour is implemented in Javascript, allowing for a high frame rate and responsive interaction, and can be used directly from the R environment or embedded in HTML documents produced using R. Single cell RNA-sequencing (scRNA-Seq) data is used to demonstrate the widget. langevitour's linear projections provide a less distorted view of this data than commonly used non-linear dimensionality reductions such as UMAP.","PeriodicalId":51285,"journal":{"name":"R Journal","volume":"104 3-4","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2023-11-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"135714319","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":4,"RegionCategory":"计算机科学","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
R JournalPub Date : 2023-11-01DOI: 10.32614/rj-2023-057
Martí Renedo-Mirambell, Argimiro Arratia
{"title":"clustAnalytics: An R Package for Assessing Stability and Significance of Communities in Networks","authors":"Martí Renedo-Mirambell, Argimiro Arratia","doi":"10.32614/rj-2023-057","DOIUrl":"https://doi.org/10.32614/rj-2023-057","url":null,"abstract":"This paper introduces the R package [clustAnalytics](https://CRAN.R-project.org/package=clustAnalytics), which comprises a set of criteria for assessing the significance and stability of communities in networks found by any clustering algorithm. [clustAnalytics](https://CRAN.R-project.org/package=clustAnalytics) works with graphs of class [igraph](https://CRAN.R-project.org/package=igraph) from the R-package [igraph](https://CRAN.R-project.org/package=igraph), extended to handle weighted and/or directed graphs. [clustAnalytics](https://CRAN.R-project.org/package=clustAnalytics) provides a set of community scoring functions, and methods to systematically compare their values to those of a suitable null model, which are of use when testing for cluster significance. It also provides a non parametric bootstrap method combined with similarity metrics derived from information theory and combinatorics, useful when testing for cluster stability, as well as a method to synthetically generate a weighted network with a ground truth community structure based on the preferential attachment model construction, producing networks with communities and scale-free degree distribution.","PeriodicalId":51285,"journal":{"name":"R Journal","volume":"110 1-2","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2023-11-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"135714465","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":4,"RegionCategory":"计算机科学","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
R JournalPub Date : 2023-11-01DOI: 10.32614/rj-2023-045
Sagiru Mati, Irfan Civcir, S. I. Abba
{"title":"EviewsR: An R Package for Dynamic and Reproducible Research Using EViews, R, R Markdown and Quarto","authors":"Sagiru Mati, Irfan Civcir, S. I. Abba","doi":"10.32614/rj-2023-045","DOIUrl":"https://doi.org/10.32614/rj-2023-045","url":null,"abstract":"EViews is a software designed for conducting econometric data analysis. There exists a one-way communication between EViews and R, as the former can run the code of the latter, but the reverse is not the case. We describe [EviewsR](https://CRAN.R-project.org/package=EviewsR), an R package which allows users of R, R Markdown and Quarto to execute EViews code. In essence, [EviewsR](https://CRAN.R-project.org/package=EviewsR) does not only provide functions for base R, but also adds EViews to the existing [knitr](https://CRAN.R-project.org/package=knitr)'s knit-engines. We also show how EViews equation, graph, series, and table objects can be imported and customised dynamically and reproducibly in R, R Markdown and Quarto document. Therefore, [EviewsR](https://CRAN.R-project.org/package=EviewsR) seeks to improve the accuracy, transparency and reproducibility of research conducted with EViews and R.","PeriodicalId":51285,"journal":{"name":"R Journal","volume":"103 5-6","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2023-11-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"135714321","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":4,"RegionCategory":"计算机科学","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
R JournalPub Date : 2023-11-01DOI: 10.32614/rj-2023-047
Rafael Fuentealba-Chaura, Daniel Guinea-Martin, Ricardo Mora, Julio Rojas-Mora
{"title":"mutualinf: An R Package for Computing and Decomposing the Mutual Information Index of Segregation","authors":"Rafael Fuentealba-Chaura, Daniel Guinea-Martin, Ricardo Mora, Julio Rojas-Mora","doi":"10.32614/rj-2023-047","DOIUrl":"https://doi.org/10.32614/rj-2023-047","url":null,"abstract":"In this article, we present the R package [mutualinf](https://CRAN.R-project.org/package=mutualinf) for computing and decomposing the mutual information index of segregation by means of recursion and parallelization techniques. The mutual information index is the only multigroup index of segregation that satisfies strong decomposability properties, both for organizational units and groups. The [mutualinf](https://CRAN.R-project.org/package=mutualinf) package contributes by (1) implementing the decomposition of the mutual information index into a \"between\" and a \"within\" term; (2) computing, in a single call, a chain of decompositions that involve one \"between\" term and several \"within\" terms; (3) providing the contributions of the variables that define the groups or the organizational units to the overall segregation; and (4) providing the demographic weights and local indexes employed in the computation of the \"within\" term. We illustrate the use of [mutualinf](https://CRAN.R-project.org/package=mutualinf) using Chilean school enrollment data. With these data, we study socioeconomic and ethnic segregation in schools.","PeriodicalId":51285,"journal":{"name":"R Journal","volume":"100 5-6","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2023-11-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"135714330","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":4,"RegionCategory":"计算机科学","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
R JournalPub Date : 2023-11-01DOI: 10.32614/rj-2023-048
James Otto, David Kahle
{"title":"ggdensity: Improved Bivariate Density Visualization in R","authors":"James Otto, David Kahle","doi":"10.32614/rj-2023-048","DOIUrl":"https://doi.org/10.32614/rj-2023-048","url":null,"abstract":"The [ggdensity](https://CRAN.R-project.org/package=ggdensity) R package extends the functionality of [ggplot2](https://CRAN.R-project.org/package=ggplot2) by providing more interpretable visualizations of bivariate density estimates using highest density regions (HDRs). The visualizations are created via drop-in replacements for the standard [ggplot2](https://CRAN.R-project.org/package=ggplot2) functions used for this purpose: geom_hdr() for geom_density_2d_filled() and geom_hdr_lines() for geom_density_2d(). These new geoms improve on those of [ggplot2](https://CRAN.R-project.org/package=ggplot2) by communicating the probabilities associated with the displayed regions. Various statistically rigorous estimators are available, as well as convenience functions geom_hdr_fun() and geom_hdr_fun_lines() for plotting HDRs of user-specified probability density functions. Associated geoms for rug plots and pointdensity scatterplots are also presented.","PeriodicalId":51285,"journal":{"name":"R Journal","volume":"99 3-4","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2023-11-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"135714153","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":4,"RegionCategory":"计算机科学","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}