Learn R Programming

dvmisc (version 1.1.4)

Convenience Functions, Moving Window Statistics, and Graphics

Description

Contains functions that do something convenient (e.g. create BMI categories), functions for calculating moving-window statistics efficiently, and functions for generating various figures (e.g. histograms with fitted probability mass/density function).

Copy Link

Version

Install

install.packages('dvmisc')

Monthly Downloads

654

Version

1.1.4

License

GPL-3

Maintainer

Dane Van Domelen

Last Published

December 16th, 2019

Functions in dvmisc (1.1.4)

cleancut

Convert Numeric to Factor with Convenient Interface
create_qgroups_svy

Create Quantile Groups (Complex Survey Data)
create_qgroups

Create Quantile Groups
bmi3

Convert Continuous BMI Values into 3-Level Factor
expand_grid

Similar to expand.grid but with Sequences Reversed and Ability to Treat Variables as Sets
bmi4

Convert Continuous BMI Values into 4-Level Factor
cut_decreasing

Cut with Decreasing Factor Levels
clean_glm

Create a Clean Summary Table from a glm Object
dvmisc

Convenience Functions, Moving Window Statistics, and Graphics
dots_bars

Plot Points +/- Error Bars
iterate

Iterate Function Over All Combinations of User-Specified Inputs, Potentially Multiple Times
headtail

Return the First and Last Part of an Object
inside

Check Whether Numeric Value Falls Inside Two Other Numeric Values
gammareg

Constant-Scale Gamma Model for Y vs. Covariates with Y Potentially Subject to Multiplicative Lognormal Errors
get_mse

Extract Mean Squared Error (MSE) from Fitted Regression Model
logit_prob

Convert Logit to Probability
n_2t_equal

Calculate Per-Group Sample Size for Two-Sample Equal Variance T-Test
mean_i

Mean of Integer Values
interval_groups

Split Continuous Variable into Equal-Width Groups
n_2t_unequal

Calculate Per-Group Sample Size for Two-Sample Unequal Variance T-Test
means_graph

Graph Means Across a Grouping Variable
logodds_graph

Graph Log-Odds of Binary Variable Across A Grouping Variable
list_override

Add Elements of Second List to First List, Replacing Elements with Same Name
mle_lnorm_lnorm

Maximum Likelihood Estimation for X[1], ..., X[n] ~ Lognormal(mu1, sigsq1) Lognormal(mu2, sigsq2)
max_n

Maximum of Numeric Values
moving_mean

Moving Averages
lognormalreg

Linear Regression of log(Y) vs. Covariates with Y Potentially Subject to Multiplicative Lognormal Errors
mle_gamma_lnorm

Maximum Likelihood Estimation for X[1], ..., X[n] ~ Gamma(alpha, beta) Lognormal(mu, sigsq)
pooled_var

Pooled Sample Variance
prob_odds

Convert Probability to Odds
min_n

Minimum of Numeric Values
which.max2

Return Index of (First) Maximum of a Vector
histo

Histogram with Added Options
odds_prob

Convert Odds to Probability
mle_lnorm

Maximum Likelihood Estimation for X[1], ..., X[n] ~ Lognormal(mu, sigsq)
plot_ll

Plot Log-Likelihood vs. Values of One Parameter
quant_groups_svy

Split Continuous Variable into Quantile Groups (Survey Version)
power_2t_unequal

Calculate Power for Two-Sample Unequal Variance T-Test
trim

Trim Tail Values off of a Vector
which.min2

Return Index of (First) Minimum of a Vector
which_min_nm

Return (Row, Column) Index of (First) Minimum of a Numeric Matrix
truerange

Range of a Vector (Not Min/Max!)
sliding_cov

Moving Covariance as Short Vector Slides Across Long Vector
quant_groups

Split Continuous Variable into Quantile Groups
mle_gamma

Maximum Likelihood Estimation for X[1], ..., X[n] ~ Gamma(alpha, beta)
power_2t_equal

Calculate Power for Two-Sample Equal Variance T-Test
prob_logit

Convert Probability to Logit
sumsim

Summarize Simulation Results
sum_i

Sum of Integer Values
reverse_cut

Reverse Cut
sliding_cor

Moving Correlations as Short Vector Slides Across Long Vector
which_max_nv

Return Index of (First) Maximum of a Numeric Vector
which_min_nv

Return Index of (First) Minimum of a Numeric Vector
which_min_im

Return (Row, Column) Index of (First) Minimum of an Integer Matrix
which_max_nm

Return (Row, Column) Index of (First) Maximum of a Numeric Matrix
which_max_iv

Return Index of (First) Maximum of an Integer Vector
which_max_im

Return (Row, Column) Index of (First) Maximum of an Integer Matrix
which_min_iv

Return Index of (First) Minimum of an Integer Vector