Learn R Programming

⚠️There's a newer version (5.2-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

201,383

Version

4.7-0

License

GPL (>= 2)

Maintainer

Frank Harrell Jr

Last Published

April 19th, 2022

Functions in Hmisc (4.7-0)

R2Measures

R2Measures
Lag

Lag a Numeric, Character, or Factor Vector
Merge

Merge Multiple Data Frames or Data Tables
Hmisc-internal

Internal Hmisc functions
HmiscOverview

Overview of Hmisc Library
Cs

Character strings from unquoted names
Save

Faciliate Use of save and load to Remote Directories
GiniMd

Gini's Mean Difference
Ecdf

Empirical Cumulative Distribution Plot
Misc

Miscellaneous Functions
areg

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

Confidence Intervals for Binomial Probabilities
biVar

Bivariate Summaries Computed Separately by a Series of Predictors
bootkm

Bootstrap Kaplan-Meier Estimates
combplotp

Combination Plot
capitalize

capitalize the first letter of a string
ciapower

Power of Interaction Test for Exponential Survival
cnvrt.coords

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

Power and Sample Size for Two-Sample Binomial Test
consolidate

Element Merging
all.is.numeric

Check if All Elements in Character Vector are Numeric
approxExtrap

Linear Extrapolation
contents

Metadata for a Data Frame
addMarginal

Add Marginal Observations
abs.error.pred

Indexes of Absolute Prediction Error for Linear Models
cpower

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

Read Comma-Separated Text Data Files
aregImpute

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

Cut a Numeric Variable into Intervals
bpplot

Box-percentile plots
curveRep

Representative Curves
deff

Design Effect and Intra-cluster Correlation
dotchart2

Enhanced Dot Chart
discrete

Discrete Vector tools
describe

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

Statistics by Categories
dataRep

Representativeness of Observations in a Data Set
data.frame.create.modify.check

Tips for Creating, Modifying, and Checking Data Frames
estSeqSim

estSeqSim
estSeqMarkovOrd

estSeqMarkovOrd
getRs

Interact with github rscripts Project
errbar

Plot Error Bars
dotchart3

Enhanced Version of dotchart Function
escapeRegex

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

Format P Values
dotchartpl

Enhanced Version of dotchart Function for plotly
gbayes

Gaussian Bayesian Posterior and Predictive Distributions
mhgr

Miscellaneous Functions for Epidemiology
histboxp

Use plotly to Draw Stratified Spike Histogram and Box Plot Statistics
first.word

First Word in a String or Expression
format.df

Format a Data Frame or Matrix for LaTeX or HTML
histbackback

Back to Back Histograms
event.convert

Event Conversion for Time-to-Event Data
ggplotlyr

ggplotlyr
equalBins

Multicolumn Formating
event.chart

Flexible Event Chart for Time-to-Event Data
gbayesSeqSim

gbayesSeqSim
hoeffd

Matrix of Hoeffding's D Statistics
knitrSet

knitr Setup and plotly Service Function
getHdata

Download and Install Datasets for Hmisc, rms, and Statistical Modeling
event.history

Produces event.history graph for survival data
html

Convert an S object to HTML
find.matches

Find Close Matches
colorFacet

Miscellaneous ggplot2 and grid Helper Functions
mApply

Apply a Function to Rows of a Matrix or Vector
mChoice

Methods for Storing and Analyzing Multiple Choice Variables
labcurve

Label Curves, Make Keys, and Interactively Draw Points and Curves
na.delete

Row-wise Deletion na.action
hdquantile

Harrell-Davis Distribution-Free Quantile Estimator
latex

Convert an S object to LaTeX, and Related Utilities
na.detail.response

Detailed Response Variable Information
label

Label Attribute of an Object
hidingTOC

Moving and Hiding Table of Contents
latexCheckOptions

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

Open a Zip File From a URL
mgp.axis

Draw Axes With Side-Specific mgp Parameters
intMarkovOrd

Compute Parameters for Proportional Odds Markov Model
minor.tick

Minor Tick Marks
num.intercepts

Extract number of intercepts
ggfreqScatter

Frequency Scatterplot
mtitle

Margin Titles
latexDotchart

Enhanced Dot Chart for LaTeX Picture Environment with epic
hist.data.frame

Histograms for Variables in a Data Frame
legendfunctions

Legend Creation Functions
latexTabular

Convert a Data Frame or Matrix to a LaTeX Tabular
impute

Generic Functions and Methods for Imputation
latexTherm

Create LaTeX Thermometers and Colored Needles
panel.bpplot

Box-Percentile Panel Function for Trellis
list.tree

Pretty-print the Structure of a Data Object
multLines

Plot Multiple Lines
na.keep

Do-nothing na.action
%nin%

Find Matching (or Non-Matching) Elements
makeNstr

creates a string that is a repeat of a substring
plsmo

Plot smoothed estimates
mdb.get

Read Tables in a Microsoft Access Database
pairUpDiff

pairUpDiff
rcorr.cens

Rank Correlation for Censored Data
rcorr

Matrix of Correlations and P-values
plotCorrM

plotCorrM
pc1

First Principal Component
nobsY

Compute Number of Observations for Left Hand Side of Formula
showPsfrag

Display image from psfrag LaTeX strings
rMultinom

Generate Multinomial Random Variables with Varying Probabilities
pstamp

Date/Time/Directory Stamp the Current Plot
rlegend

Special Version of legend for R
prnz

Print and Object with its Name
partition

Patitions an object into different sets
popower

Power and Sample Size for Ordinal Response
rm.boot

Bootstrap Repeated Measurements Model
print.char.list

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

Creates a string of arbitry length
simMarkovOrd

simMarkovOrd
sedit

Character String Editing and Miscellaneous Character Handling Functions
print.char.matrix

Function to print a matrix with stacked cells
simplifyDims

List Simplification
rcspline.plot

Plot Restricted Cubic Spline Function
somers2

Somers' Dxy Rank Correlation
plotlyM

plotly Multiple
simRegOrd

Simulate Power for Adjusted Ordinal Regression Two-Sample Test
plotCorrPrecision

Plot Precision of Estimate of Pearson Correlation Coefficient
prselect

Selectively Print Lines of a Text Vector
rcorrp.cens

Rank Correlation for Paired Predictors with a Possibly Censored Response, and Integrated Discrimination Index
rcspline.restate

Re-state Restricted Cubic Spline Function
samplesize.bin

Sample Size for 2-sample Binomial
rcspline.eval

Restricted Cubic Spline Design Matrix
stat_plsmo

Add a lowess smoother without counfidence bands.
translate

Translate Vector or Matrix of Text Strings
stata.get

Enhanced Importing of STATA Files
reShape

Reshape Matrices and Serial Data
transcan

Transformations/Imputations using Canonical Variates
redun

Redundancy Analysis
show.pch

Display Colors, Plotting Symbols, and Symbol Numeric Equivalents
summaryM

Summarize Mixed Data Types vs. Groups
summaryP

Multi-way Summary of Proportions
soprobMarkovOrdm

soprobMarkovOrdm
stringDims

String Dimentions
trunc.POSIXt

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

Simulate Power of 2-Sample Test for Survival under Complex Conditions
sasxport.get

Enhanced Importing of SAS Transport Files using read.xport
upFirst

Change First Letters to Upper Case
subplot

Embed a new plot within an existing plot
scat1d

One-Dimensional Scatter Diagram, Spike Histogram, or Density
upData

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

xyplot and dotplot with Matrix Variables to Plot Error Bars and Bands
wtd.stats

Weighted Statistical Estimates
solvet

solve Function with tol argument
smean.sd

Compute Summary Statistics on a Vector
soprobMarkovOrd

soprobMarkovOrd
units

Units Attribute of a Vector
summaryS

Summarize Multiple Response Variables and Make Multipanel Scatter or Dot Plot
xtfrm.labelled

Auxiliary Function Method for Sorting and Ranking
summaryRc

Graphical Summarization of Continuous Variables Against a Response
tex

function for use in graphs that are used with the psfrag package in LaTeX
string.bounding.box

Determine Dimensions of Strings
string.break.line

Break a String into Many Lines at Newlines
xy.group

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

Additive Regression and Transformations using ace or avas
symbol.freq

Graphic Representation of a Frequency Table
sys

Run Unix or Dos Depending on System
score.binary

Score a Series of Binary Variables
src

Source a File from the Current Working Directory
t.test.cluster

t-test for Clustered Data
varclus

Variable Clustering
valueTags

Store Descriptive Information About an Object
spss.get

Enhanced Importing of SPSS Files
summarize

Summarize Scalars or Matrices by Cross-Classification
summary.formula

Summarize Data for Making Tables and Plots
yearDays

Get Number of Days in Year or Month
tabulr

Interface to Tabular Function
ynbind

Combine Variables in a Matrix