Learn R Programming

⚠️There's a newer version (5.1-3) of this package.Take me there.

Hmisc

Harrell Miscellaneous

Current Goals

Web Sites

To Do

  • Consider using the haven package for importing SAS, Stata, and SPSS files; haven stores labels as the label attribute of each variable as does Hmisc; it converts date and time variables automatically and allows one to specify a format catalog along with the primary dataset
  • See if the readstata13 package has advantages over the foreign package for Stata file import
  • Consider creating xl.get using the readxl package to read .xls and .xlsx Excel files
  • In impute.transcan, sense if a variable in data is not a factor whereas it was treated as a factor during aregImpute; it should be converted to factor before the line v[sub] <- ... levels(as.integer...)) is run

Copy Link

Version

Install

install.packages('Hmisc')

Monthly Downloads

215,746

Version

4.6-0

License

GPL (>= 2)

Last Published

October 7th, 2021

Functions in Hmisc (4.6-0)

Misc

Miscellaneous Functions
aregImpute

Multiple Imputation using Additive Regression, Bootstrapping, and Predictive Mean Matching
Cs

Character strings from unquoted names
biVar

Bivariate Summaries Computed Separately by a Series of Predictors
Ecdf

Empirical Cumulative Distribution Plot
Merge

Merge Multiple Data Frames or Data Tables
Lag

Lag a Numeric, Character, or Factor Vector
approxExtrap

Linear Extrapolation
GiniMd

Gini's Mean Difference
Hmisc-internal

Internal Hmisc functions
areg

Additive Regression with Optimal Transformations on Both Sides using Canonical Variates
all.is.numeric

Check if All Elements in Character Vector are Numeric
addMarginal

Add Marginal Observations
abs.error.pred

Indexes of Absolute Prediction Error for Linear Models
Save

Faciliate Use of save and load to Remote Directories
bpower

Power and Sample Size for Two-Sample Binomial Test
bpplot

Box-percentile plots
capitalize

capitalize the first letter of a string
bystats

Statistics by Categories
dotchartpl

Enhanced Version of dotchart Function for plotly
mhgr

Miscellaneous Functions for Epidemiology
dotchart2

Enhanced Dot Chart
escapeRegex

Escapes any characters that would have special meaning in a reqular expression.
contents

Metadata for a Data Frame
bootkm

Bootstrap Kaplan-Meier Estimates
cpower

Power of Cox/log-rank Two-Sample Test
csv.get

Read Comma-Separated Text Data Files
dotchart3

Enhanced Version of dotchart Function
binconf

Confidence Intervals for Binomial Probabilities
find.matches

Find Close Matches
gbayesSeqSim

gbayesSeqSim
first.word

First Word in a String or Expression
gbayes

Gaussian Bayesian Posterior and Predictive Distributions
combplotp

Combination Plot
consolidate

Element Merging
event.history

Produces event.history graph for survival data
curveRep

Representative Curves
dataRep

Representativeness of Observations in a Data Set
event.convert

Event Conversion for Time-to-Event Data
intMarkovOrd

Compute Parameters for Proportional Odds Markov Model
ciapower

Power of Interaction Test for Exponential Survival
cnvrt.coords

Convert between the 5 different coordinate sytems on a graphical device
ggfreqScatter

Frequency Scatterplot
knitrSet

knitr Setup and plotly Service Function
deff

Design Effect and Intra-cluster Correlation
hidingTOC

Moving and Hiding Table of Contents
ggplotlyr

ggplotlyr
estSeqMarkovOrd

estSeqMarkovOrd
hdquantile

Harrell-Davis Distribution-Free Quantile Estimator
cut2

Cut a Numeric Variable into Intervals
latexDotchart

Enhanced Dot Chart for LaTeX Picture Environment with epic
multLines

Plot Multiple Lines
latexTabular

Convert a Data Frame or Matrix to a LaTeX Tabular
na.delete

Row-wise Deletion na.action
sasxport.get

Enhanced Importing of SAS Transport Files using read.xport
data.frame.create.modify.check

Tips for Creating, Modifying, and Checking Data Frames
colorFacet

Miscellaneous ggplot2 and grid Helper Functions
getZip

Open a Zip File From a URL
scat1d

One-Dimensional Scatter Diagram, Spike Histogram, or Density
stata.get

Enhanced Importing of STATA Files
string.bounding.box

Determine Dimensions of Strings
errbar

Plot Error Bars
equalBins

Multicolumn Formating
getHdata

Download and Install Datasets for Hmisc, rms, and Statistical Modeling
discrete

Discrete Vector tools
describe

Concise Statistical Description of a Vector, Matrix, Data Frame, or Formula
getRs

Interact with github rscripts Project
labcurve

Label Curves, Make Keys, and Interactively Draw Points and Curves
stringDims

String Dimentions
t.test.cluster

t-test for Clustered Data
xtfrm.labelled

Auxiliary Function Method for Sorting and Ranking
sys

Run Unix or Dos Depending on System
string.break.line

Break a String into Many Lines at Newlines
xYplot

xyplot and dotplot with Matrix Variables to Plot Error Bars and Bands
latex

Convert an S object to LaTeX, and Related Utilities
mtitle

Margin Titles
latexCheckOptions

Check whether the options for latex functions have been specified.
pairUpDiff

pairUpDiff
minor.tick

Minor Tick Marks
hist.data.frame

Histograms for Variables in a Data Frame
histbackback

Back to Back Histograms
num.intercepts

Extract number of intercepts
html

Convert an S object to HTML
estSeqSim

estSeqSim
prnz

Print and Object with its Name
nstr

Creates a string of arbitry length
plotCorrM

plotCorrM
print.char.matrix

Function to print a matrix with stacked cells
mdb.get

Read Tables in a Microsoft Access Database
label

Label Attribute of an Object
panel.bpplot

Box-Percentile Panel Function for Trellis
plotCorrPrecision

Plot Precision of Estimate of Pearson Correlation Coefficient
legendfunctions

Legend Creation Functions
event.chart

Flexible Event Chart for Time-to-Event Data
latexTherm

Create LaTeX Thermometers and Colored Needles
mgp.axis

Draw Axes With Side-Specific mgp Parameters
impute

Generic Functions and Methods for Imputation
na.keep

Do-nothing na.action
partition

Patitions an object into different sets
na.detail.response

Detailed Response Variable Information
pc1

First Principal Component
plotlyM

plotly Multiple
showPsfrag

Display image from psfrag LaTeX strings
samplesize.bin

Sample Size for 2-sample Binomial
rm.boot

Bootstrap Repeated Measurements Model
pstamp

Date/Time/Directory Stamp the Current Plot
show.pch

Display Colors, Plotting Symbols, and Symbol Numeric Equivalents
summaryS

Summarize Multiple Response Variables and Make Multipanel Scatter or Dot Plot
rlegend

Special Version of legend for R
prselect

Selectively Print Lines of a Text Vector
redun

Redundancy Analysis
simplifyDims

List Simplification
symbol.freq

Graphic Representation of a Frequency Table
tabulr

Interface to Tabular Function
tex

function for use in graphs that are used with the psfrag package in LaTeX
smean.sd

Compute Summary Statistics on a Vector
simMarkovOrd

simMarkovOrd
solvet

solve Function with tol argument
plsmo

Plot smoothed estimates
rcspline.restate

Re-state Restricted Cubic Spline Function
reShape

Reshape Matrices and Serial Data
simRegOrd

Simulate Power for Adjusted Ordinal Regression Two-Sample Test
spss.get

Enhanced Importing of SPSS Files
spower

Simulate Power of 2-Sample Test for Survival under Complex Conditions
summaryM

Summarize Mixed Data Types vs. Groups
units

Units Attribute of a Vector
summary.formula

Summarize Data for Making Tables and Plots
subplot

Embed a new plot within an existing plot
somers2

Somers' Dxy Rank Correlation
summarize

Summarize Scalars or Matrices by Cross-Classification
upData

Update a Data Frame or Cleanup a Data Frame after Importing
ynbind

Combine Variables in a Matrix
translate

Translate Vector or Matrix of Text Strings
format.df

Format a Data Frame or Matrix for LaTeX or HTML
rMultinom

Generate Multinomial Random Variables with Varying Probabilities
format.pval

Format P Values
trunc.POSIXt

Return the floor, ceiling, or rounded value of date or time to specified unit.
rcorr

Matrix of Correlations and P-values
upFirst

Change First Letters to Upper Case
varclus

Variable Clustering
wtd.stats

Weighted Statistical Estimates
histboxp

Use plotly to Draw Stratified Spike Histogram and Box Plot Statistics
valueTags

Store Descriptive Information About an Object
hoeffd

Matrix of Hoeffding's D Statistics
rcorr.cens

Rank Correlation for Censored Data
list.tree

Pretty-print the Structure of a Data Object
mApply

Apply a Function to Rows of a Matrix or Vector
score.binary

Score a Series of Binary Variables
rcorrp.cens

Rank Correlation for Paired Predictors with a Possibly Censored Response, and Integrated Discrimination Index
stat_plsmo

Add a lowess smoother without counfidence bands.
summaryRc

Graphical Summarization of Continuous Variables Against a Response
sedit

Character String Editing and Miscellaneous Character Handling Functions
src

Source a File from the Current Working Directory
summaryP

Multi-way Summary of Proportions
mChoice

Methods for Storing and Analyzing Multiple Choice Variables
makeNstr

creates a string that is a repeat of a substring
transace

Additive Regression and Transformations using ace or avas
%nin%

Find Matching (or Non-Matching) Elements
transcan

Transformations/Imputations using Canonical Variates
nobsY

Compute Number of Observations for Left Hand Side of Formula
yearDays

Get Number of Days in Year or Month
xy.group

Mean x vs. function of y in groups of x
popower

Power and Sample Size for Ordinal Response
print.char.list

prints a list of lists in a visually readable format.
soprobMarkovOrd

soprobMarkovOrd
rcspline.plot

Plot Restricted Cubic Spline Function
soprobMarkovOrdm

soprobMarkovOrdm
rcspline.eval

Restricted Cubic Spline Design Matrix
HmiscOverview

Overview of Hmisc Library