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

5.1-1

License

GPL (>= 2)

Last Published

September 12th, 2023

Functions in Hmisc (5.1-1)

Misc

Miscellaneous Functions
HmiscOverview

Overview of Hmisc Library
R2Measures

R2Measures
GiniMd

Gini's Mean Difference
Save

Faciliate Use of save and load to Remote Directories
Lag

Lag a Numeric, Character, or Factor Vector
Merge

Merge Multiple Data Frames or Data Tables
addggLayers

addggLayers
Cs

Character strings from unquoted names
Hmisc-internal

Internal Hmisc functions
Ecdf

Empirical Cumulative Distribution Plot
all.is.numeric

Check if All Elements in Character Vector are Numeric
approxExtrap

Linear Extrapolation
areg

Additive Regression with Optimal Transformations on Both Sides using Canonical Variates
aregImpute

Multiple Imputation using Additive Regression, Bootstrapping, and Predictive Mean Matching
abs.error.pred

Indexes of Absolute Prediction Error for Linear Models
addMarginal

Add Marginal Observations
bystats

Statistics by Categories
binconf

Confidence Intervals for Binomial Probabilities
ciapower

Power of Interaction Test for Exponential Survival
bootkm

Bootstrap Kaplan-Meier Estimates
biVar

Bivariate Summaries Computed Separately by a Series of Predictors
capitalize

capitalize the first letter of a string
cnvrt.coords

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

Power and Sample Size for Two-Sample Binomial Test
csv.get

Read Comma-Separated Text Data Files
curveRep

Representative Curves
combine.levels

combine.levels
combplotp

Combination Plot
bpplot

Box-percentile plots
completer

completer
consolidate

Element Merging
cut2

Cut a Numeric Variable into Intervals
data.frame.create.modify.check

Tips for Creating, Modifying, and Checking Data Frames
describe

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

Metadata for a Data Frame
discrete

Discrete Vector tools
find.matches

Find Close Matches
first.word

First Word in a String or Expression
equalBins

Multicolumn Formating
dataRep

Representativeness of Observations in a Data Set
deff

Design Effect and Intra-cluster Correlation
ecdfSteps

ecdfSteps
escapeRegex

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

estSeqMarkovOrd
errbar

Plot Error Bars
cpower

Power of Cox/log-rank Two-Sample Test
mhgr

Miscellaneous Functions for Epidemiology
dotchartpl

Enhanced Version of dotchart Function for plotly
getZip

Open a Zip File From a URL
hdquantile

Harrell-Davis Distribution-Free Quantile Estimator
hidingTOC

Moving and Hiding Table of Contents
extractlabs

extractlabs
ebpcomp

ebpcomp
fImport

fImport
getabd

getabd
movStats

movStats
gbayes

Gaussian Bayesian Posterior and Predictive Distributions
gbayesSeqSim

gbayesSeqSim
mtitle

Margin Titles
estSeqSim

estSeqSim
label

Label Attribute of an Object
hist.data.frame

Histograms for Variables in a Data Frame
event.chart

Flexible Event Chart for Time-to-Event Data
dotchart2

Enhanced Dot Chart
dotchart3

Enhanced Version of dotchart Function
histbackback

Back to Back Histograms
event.convert

Event Conversion for Time-to-Event Data
latex

Convert an S object to LaTeX, and Related Utilities
event.history

Produces event.history graph for survival data
latestFile

latestFile
latexCheckOptions

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

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

Interact with github rscripts Project
ggplotlyr

ggplotlyr
format.df

Format a Data Frame or Matrix for LaTeX or HTML
format.pval

Format P Values
colorFacet

Miscellaneous ggplot2 and grid Helper Functions
histboxp

Use plotly to Draw Stratified Spike Histogram and Box Plot Statistics
list.tree

Pretty-print the Structure of a Data Object
hashCheck

hashCheck
ggfreqScatter

Frequency Scatterplot
mgp.axis

Draw Axes With Side-Specific mgp Parameters
hlab

hlab
mApply

Apply a Function to Rows of a Matrix or Vector
latexDotchart

Enhanced Dot Chart for LaTeX Picture Environment with epic
latexTabular

Convert a Data Frame or Matrix to a LaTeX Tabular
pc1

First Principal Component
minor.tick

Minor Tick Marks
mChoice

Methods for Storing and Analyzing Multiple Choice Variables
plot.princmp

plot.princmp
prselect

Selectively Print Lines of a Text Vector
makeNstr

creates a string that is a repeat of a substring
na.delete

Row-wise Deletion na.action
hlabs

hlabs
na.detail.response

Detailed Response Variable Information
hoeffd

Matrix of Hoeffding's D Statistics
multLines

Plot Multiple Lines
html

Convert an S object to HTML
impute

Generic Functions and Methods for Imputation
intMarkovOrd

intMarkovOrd
print.char.list

prints a list of lists in a visually readable format.
print.char.matrix

Function to print a matrix with stacked cells
htmltabv

htmltabc
nCoincident

nCoincident
rcorrp.cens

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

Create LaTeX Thermometers and Colored Needles
pstamp

Date/Time/Directory Stamp the Current Plot
knitrSet

knitr Setup and plotly Service Function
num.intercepts

Extract number of intercepts
rcspline.plot

Plot Restricted Cubic Spline Function
labcurve

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

pairUpDiff
popower

Power and Sample Size for Ordinal Response
legendfunctions

Legend Creation Functions
rcspline.restate

Re-state Restricted Cubic Spline Function
rcspline.eval

Restricted Cubic Spline Design Matrix
na.keep

Do-nothing na.action
samplesize.bin

Sample Size for 2-sample Binomial
solvet

solve Function with tol argument
sasxport.get

Enhanced Importing of SAS Transport Files using read.xport
spikecomp

spikecomp
spower

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

Somers' Dxy Rank Correlation
stat_plsmo

Add a lowess smoother without counfidence bands.
stata.get

Enhanced Importing of STATA Files
string.bounding.box

Determine Dimensions of Strings
mdb.get

Read Tables in a Microsoft Access Database
princmp

princmp
string.break.line

Break a String into Many Lines at Newlines
meltData

meltData
rcorr

Matrix of Correlations and P-values
summaryRc

Graphical Summarization of Continuous Variables Against a Response
nobsY

Compute Number of Observations for Left Hand Side of Formula
rcorr.cens

Rank Correlation for Censored Data
%nin%

Find Matching (or Non-Matching) Elements
nstr

Creates a string of arbitry length
testCharDateTime

testCharDateTime
tex

function for use in graphs that are used with the psfrag package in LaTeX
runParallel

runParallel
runifChanged

runifChanged
upFirst

Change First Letters to Upper Case
valueTags

Store Descriptive Information About an Object
summaryS

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

simMarkovOrd
units

Units Attribute of a Vector
simRegOrd

Simulate Power for Adjusted Ordinal Regression Two-Sample Test
plotCorrM

plotCorrM
plotCorrPrecision

Plot Precision of Estimate of Pearson Correlation Coefficient
spss.get

Enhanced Importing of SPSS Files
upData

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

Source a File from the Current Working Directory
translate

Translate Vector or Matrix of Text Strings
wtd.stats

Weighted Statistical Estimates
trunc.POSIXt

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

One-Dimensional Scatter Diagram, Spike Histogram, or Density
panel.bpplot

Box-Percentile Panel Function for Trellis
xtfrm.labelled

Auxiliary Function Method for Sorting and Ranking
xYplot

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

plotly Multiple
score.binary

Score a Series of Binary Variables
partition

Patitions an object into different sets
print.princmp

print.princmp
xy.group

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

Plot smoothed estimates
qcrypt

qcrypt
rMultinom

Generate Multinomial Random Variables with Varying Probabilities
soprobMarkovOrd

soprobMarkovOrd
prnz

Print and Object with its Name
reShape

Reshape Matrices and Serial Data
redun

Redundancy Analysis
show.pch

Display Colors, Plotting Symbols, and Symbol Numeric Equivalents
soprobMarkovOrdm

soprobMarkovOrdm
showPsfrag

Display image from psfrag LaTeX strings
rlegend

Special Version of legend for R
summarize

Summarize Scalars or Matrices by Cross-Classification
symbol.freq

Graphic Representation of a Frequency Table
rm.boot

Bootstrap Repeated Measurements Model
summary.formula

Summarize Data for Making Tables and Plots
sedit

Character String Editing and Miscellaneous Character Handling Functions
t.test.cluster

t-test for Clustered Data
tabulr

Interface to Tabular Function
sys

Run Unix or Dos Depending on System
seqFreq

seqFreq
transace

Additive Regression and Transformations using ace or avas
simplifyDims

List Simplification
smean.sd

Compute Summary Statistics on a Vector
stringDims

String Dimentions
transcan

Transformations/Imputations using Canonical Variates
subplot

Embed a new plot within an existing plot
summaryM

Summarize Mixed Data Types vs. Groups
summaryP

Multi-way Summary of Proportions
varclus

Variable Clustering
vlab

vlab
yearDays

Get Number of Days in Year or Month
ynbind

Combine Variables in a Matrix