The gt_plt_conf_int() function takes an existing GT object and adds horizontal confidence interval plots to a specified column. Each cell displays a horizontal bar representing the confidence interval, with a dot indicating the mean value. Optionally, the lower and upper confidence interval bounds can be provided directly, or the function can compute them.
If ci_columns is not provided, the function assumes each cell in column contains a list of values and computes the confidence interval using a t-distribution.
Parameters
gt:GT
A GT object to modify.
column:SelectExpr
The column that contains the mean of the sample. This can either be a single number per row, if you have calculated the values ahead of time, or a list of values if you want to calculate the confidence intervals.
ci_columns:SelectExpr=None
Optional columns representing the left/right confidence intervals of your sample. If None, the confidence interval will be computed from the data in column using a t-distribution.
ci:float=0.95
The confidence level to use when computing the interval (if ci_columns is None).
width:float=100
The width of the confidence interval plot in pixels. Note that if the width is too narrow, some label text may overlap.
height:float=30
The width of the confidence interval plot in pixels.
dot_color:str='red'
The color of the mean dot.
dot_border_color:str='red'
The color of the border around the mean dot.
line_color:str='royalblue'
The color of the confidence interval bar.
text_color:str='black'
The color of the confidence interval labels.
font_size:int=10
The size of the text for the confidence interval labels. A value of 0 will result in hiding the text.
num_decimals:int=1
The number of decimals to display when rounding the value of the confidence interval labels.
Returns
:GT
A GT object with confidence interval plots added to the specified column.