Learn R Programming

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

202,596

Version

5.1-2

License

GPL (>= 2)

Last Published

March 11th, 2024

Functions in Hmisc (5.1-2)

Lag

Lag a Numeric, Character, or Factor Vector
R2Measures

R2Measures
Misc

Miscellaneous Functions
Save

Faciliate Use of save and load to Remote Directories
Merge

Merge Multiple Data Frames or Data Tables
GiniMd

Gini's Mean Difference
Hmisc-internal

Internal Hmisc functions
approxExtrap

Linear Extrapolation
aregImpute

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

Bivariate Summaries Computed Separately by a Series of Predictors
completer

completer
bpower

Power and Sample Size for Two-Sample Binomial Test
HmiscOverview

Overview of Hmisc Library
areg

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

Statistics by Categories
capitalize

capitalize the first letter of a string
Cs

Character strings from unquoted names
dataRep

Representativeness of Observations in a Data Set
binconf

Confidence Intervals for Binomial Probabilities
bootkm

Bootstrap Kaplan-Meier Estimates
consolidate

Element Merging
ciapower

Power of Interaction Test for Exponential Survival
Ecdf

Empirical Cumulative Distribution Plot
addggLayers

addggLayers
bpplot

Box-percentile plots
abs.error.pred

Indexes of Absolute Prediction Error for Linear Models
deff

Design Effect and Intra-cluster Correlation
find.matches

Find Close Matches
addMarginal

Add Marginal Observations
cnvrt.coords

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

Metadata for a Data Frame
cut2

Cut a Numeric Variable into Intervals
all.is.numeric

Check if All Elements in Character Vector are Numeric
first.word

First Word in a String or Expression
cpower

Power of Cox/log-rank Two-Sample Test
data.frame.create.modify.check

Tips for Creating, Modifying, and Checking Data Frames
combine.levels

combine.levels
getHdata

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

Combination Plot
describe

Concise Statistical Description of a Vector, Matrix, Data Frame, or Formula
csv.get

Read Comma-Separated Text Data Files
escapeRegex

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

Enhanced Dot Chart
estSeqMarkovOrd

estSeqMarkovOrd
dotchart3

Enhanced Version of dotchart Function
event.convert

Event Conversion for Time-to-Event Data
extractlabs

extractlabs
curveRep

Representative Curves
getRs

Interact with github rscripts Project
ecdfSteps

ecdfSteps
mhgr

Miscellaneous Functions for Epidemiology
format.df

Format a Data Frame or Matrix for LaTeX or HTML
fImport

fImport
dotchartpl

Enhanced Version of dotchart Function for plotly
discrete

Discrete Vector tools
getZip

Open a Zip File From a URL
getabd

getabd
hist.data.frame

Histograms for Variables in a Data Frame
ebpcomp

ebpcomp
equalBins

Multicolumn Formating
errbar

Plot Error Bars
histbackback

Back to Back Histograms
ggplotlyr

ggplotlyr
format.pval

Format P Values
histboxp

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

hashCheck
event.history

Produces event.history graph for survival data
estSeqSim

estSeqSim
knitrSet

knitr Setup and plotly Service Function
gbayes

Gaussian Bayesian Posterior and Predictive Distributions
hlab

hlab
latexDotchart

Enhanced Dot Chart for LaTeX Picture Environment with epic
labcurve

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

Convert a Data Frame or Matrix to a LaTeX Tabular
mgp.axis

Draw Axes With Side-Specific mgp Parameters
na.keep

Do-nothing na.action
html

Convert an S object to HTML
htmltabv

htmltabc
event.chart

Flexible Event Chart for Time-to-Event Data
gbayesSeqSim

gbayesSeqSim
hlabs

hlabs
%nin%

Find Matching (or Non-Matching) Elements
hoeffd

Matrix of Hoeffding's D Statistics
impute

Generic Functions and Methods for Imputation
colorFacet

Miscellaneous ggplot2 and grid Helper Functions
num.intercepts

Extract number of intercepts
pairUpDiff

pairUpDiff
ggfreqScatter

Frequency Scatterplot
minor.tick

Minor Tick Marks
rlegend

Special Version of legend for R
rm.boot

Bootstrap Repeated Measurements Model
runParallel

runParallel
label

Label Attribute of an Object
latexTherm

Create LaTeX Thermometers and Colored Needles
na.delete

Row-wise Deletion na.action
hdquantile

Harrell-Davis Distribution-Free Quantile Estimator
na.detail.response

Detailed Response Variable Information
runifChanged

runifChanged
intMarkovOrd

intMarkovOrd
latestFile

latestFile
mdb.get

Read Tables in a Microsoft Access Database
hidingTOC

Moving and Hiding Table of Contents
list.tree

Pretty-print the Structure of a Data Object
simMarkovOrd

simMarkovOrd
meltData

meltData
panel.bpplot

Box-Percentile Panel Function for Trellis
legendfunctions

Legend Creation Functions
partition

Patitions an object into different sets
plotlyM

plotly Multiple
nobsY

Compute Number of Observations for Left Hand Side of Formula
nstr

Creates a string of arbitry length
plsmo

Plot smoothed estimates
print.princmp

print.princmp
prnz

Print and Object with its Name
plotCorrM

plotCorrM
mApply

Apply a Function to Rows of a Matrix or Vector
simRegOrd

Simulate Power for Adjusted Ordinal Regression Two-Sample Test
latex

Convert an S object to LaTeX, and Related Utilities
reShape

Reshape Matrices and Serial Data
stat_plsmo

Add a lowess smoother without counfidence bands.
latexCheckOptions

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

Methods for Storing and Analyzing Multiple Choice Variables
makeNstr

creates a string that is a repeat of a substring
stata.get

Enhanced Importing of STATA Files
redun

Redundancy Analysis
samplesize.bin

Sample Size for 2-sample Binomial
movStats

movStats
sasxport.get

Enhanced Importing of SAS Transport Files using read.xport
mtitle

Margin Titles
multLines

Plot Multiple Lines
solvet

solve Function with tol argument
popower

Power and Sample Size for Ordinal Response
princmp

princmp
rcorr

Matrix of Correlations and P-values
qcrypt

qcrypt
summaryRc

Graphical Summarization of Continuous Variables Against a Response
rcorr.cens

Rank Correlation for Censored Data
rMultinom

Generate Multinomial Random Variables with Varying Probabilities
summaryS

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

Plot Precision of Estimate of Pearson Correlation Coefficient
stringDims

String Dimentions
prselect

Selectively Print Lines of a Text Vector
subplot

Embed a new plot within an existing plot
upFirst

Change First Letters to Upper Case
valueTags

Store Descriptive Information About an Object
sedit

Character String Editing and Miscellaneous Character Handling Functions
nCoincident

nCoincident
somers2

Somers' Dxy Rank Correlation
seqFreq

seqFreq
varclus

Variable Clustering
spss.get

Enhanced Importing of SPSS Files
simplifyDims

List Simplification
pc1

First Principal Component
src

Source a File from the Current Working Directory
smean.sd

Compute Summary Statistics on a Vector
t.test.cluster

t-test for Clustered Data
string.bounding.box

Determine Dimensions of Strings
tabulr

Interface to Tabular Function
string.break.line

Break a String into Many Lines at Newlines
vlab

vlab
yearDays

Get Number of Days in Year or Month
plot.princmp

plot.princmp
symbol.freq

Graphic Representation of a Frequency Table
translate

Translate Vector or Matrix of Text Strings
sys

Run Unix or Dos Depending on System
print.char.list

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

Function to print a matrix with stacked cells
wtd.stats

Weighted Statistical Estimates
ynbind

Combine Variables in a Matrix
rcorrp.cens

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

Restricted Cubic Spline Design Matrix
xYplot

xyplot and dotplot with Matrix Variables to Plot Error Bars and Bands
trunc.POSIXt

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

Date/Time/Directory Stamp the Current Plot
rcspline.plot

Plot Restricted Cubic Spline Function
rcspline.restate

Re-state Restricted Cubic Spline Function
scat1d

One-Dimensional Scatter Diagram, Spike Histogram, or Density
show.pch

Display Colors, Plotting Symbols, and Symbol Numeric Equivalents
showPsfrag

Display image from psfrag LaTeX strings
score.binary

Score a Series of Binary Variables
soprobMarkovOrd

soprobMarkovOrd
soprobMarkovOrdm

soprobMarkovOrdm
spikecomp

spikecomp
spower

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

Summarize Scalars or Matrices by Cross-Classification
summary.formula

Summarize Data for Making Tables and Plots
testCharDateTime

testCharDateTime
tex

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

Summarize Mixed Data Types vs. Groups
transace

Additive Regression and Transformations using ace or avas
transcan

Transformations/Imputations using Canonical Variates
xtfrm.labelled

Auxiliary Function Method for Sorting and Ranking
summaryP

Multi-way Summary of Proportions
xy.group

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

Units Attribute of a Vector
upData

Update a Data Frame or Cleanup a Data Frame after Importing