View source: R/GROUP.PROFILES.R
| GROUP.PROFILES | R Documentation |
Produces profile plots of group means for one or more continuous outcome variables.
GROUP.PROFILES(data, groups, variables,
plot_type ='bar', bar_type = 'all',
rescale='standardize',
CI_level= 95, ylim=NULL,
plot_save = FALSE, plot_save_type = 'png', plot_title = NULL,
cols_user = NULL,
verbose=TRUE)
data |
A dataframe where the rows are cases and the columns are the variables. |
groups |
The name of the groups variable in data, e.g., groups = 'Group'. |
variables |
The name of the dependent (outcome) variable(s) in data, e.g., variables = c('esteem','anxiety'). |
plot_type |
The options are 'bar' for bar plot, or 'profile' for a lines profile plot. |
bar_type |
When plot_type = 'bar', the options for bar_type are 'all', for placing the bar plots for all variables in one plot, or 'separate', for placing the bar plots for the variables in separate plots. |
rescale |
(optional) Should the variables be rescaled into a common metric? The options are 'no' (the default), or 'standardize'. |
CI_level |
(optional) The confidence interval for the input, if provided (in whole numbers). The default is 95. |
ylim |
(optional) Limits for the y-axis, e.g., ylim = c(0, 5). Not implemented when multiple bar plots are requested. |
plot_save |
Should a plot be saved to disk? TRUE or FALSE (the default). |
plot_save_type |
The output format if plot_save = TRUE. The options are 'bitmap', 'tiff', 'png' (the default), 'jpeg', and 'bmp'. |
plot_title |
(optional) A title for the plot.
|
cols_user |
A vector of colours for the groups.
|
verbose |
(optional) Should detailed results be displayed in console? |
The continuous 'variables' can be rescaled (standardized) into the same metric to facilitate interpretation when the variables that are in different metrics are placed on one plot.
When plot_type = 'bar' and bar_type = 'separate', a maximum of four plots will be produced, for the first four 'variables'.
If verbose = TRUE, the displayed output includes the means, standard deviations, Ns, and confidence intervals for the groups on the variables.
Brian P. O'Connor
GROUP.PROFILES(data = data_DFA$Ho_2014,
groups = 'group_1_fac',
variables = c("fast_ris", "disresp", "sen_seek", "danger"),
rescale= 'data',
plot_type ='bar',
bar_type = 'separate')
#first run DFA
DFA_output <- DFA(data = data_DFA$Field_2012,
groups = 'Group',
variables = c('Actions','Thoughts'),
predictive = TRUE,
priorprob = 'EQUAL',
covmat_type='separate',
verbose = TRUE)
# then produce a profile plot of the group centroids on the discriminant functions
GROUP.PROFILES(data = DFA_output$dfa_scores,
groups = 'group',
variables = c('Function.1','Function.2'),
rescale= 'no',
plot_type ='profile',
bar_type = 'separate')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.