pt_transform | R Documentation |
This function helps users to determine whether a transformation of log or square-root would be appropriate for a specific purchase task indicator. Specifically, it provides values which measure skewness and kurtosis, as well as the minimum and maximum values of z-scores.
pt_transform(pt, pt_var, zero_val = 0.001, distribution = TRUE)
pt |
A data frame consisting of the purchase variable 'pt_var' to visualize. |
pt_var |
The name of the purchase task variable to visualize, as identified in the data frame. |
zero_val |
The small constant value to add to zero-value responses to allow for transformation. The default is 0.001. |
distribution |
A logical argument on whether a plot should be produced. The default is TRUE. |
A data frame with transformation diagnostics for the 'pt_var'. If distribution is set to TRUE, then a ggplot2 graphical object is also returned.
### --- Example Data
pt <- data.frame("ID" = c(1:36),
"Breakpoint" = c(1,2,5,0,10,3,0.5,0.2,0.3,3,4,5,7.5,0.5,2,0,0.1,
0.5,0.5,0,3,2,2,1,2,3,4,1,0,2,0,5,5,7.5,2,3))
### --- Function Example
pt_transform(pt, pt_var = "Breakpoint")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.