Skip to contents

Add 3d layers to plotly objects

add_3d_surface()
Add 3D regression surface to a plot_ly object
add_direction()
A flexible function to add a line of predicted effects to the plotly surface with optional confidence intervals.
add_jitter()
Jitter scattercloud points
add_marginals()
Add 3d marginal effects to a plot_ly object

Create data for 3D graphics

These functions use the specified model to generate the x, y, and z values required to create regression surfaces and marginal effects.

create_surface_data()
Create data frame used to plot a surface of predicted y values
create_y_estimates()
Create predicted y values from a data frame of x values.

Data

Data used in the articles and examples.

county_data
County level voting and demographics data.
cali_counties
County level voting and demographics data for California counties.
hair_data
Simulated hair length data