--outcome_interaction

Switch

--outcome_interaction <interaction variable>

Description

Generate correlations for --outcomes like the default --correlate but including a term that is the product of the outcome_interaction variable and the feature group norm variable.

Argument and Default Value

interaction variable - The column name of the variable that you would like use in your interaction term. This column must exist in the outcomes table.

Details

These values are generated by using least squares linear regression. For each feature/outcome pair, we normalize all variables, including feature group norms, control variables and outcome variables by subtracting the mean and dividing by the standard deviation, thus creating a data distribution that has a mean of zero and a standard deviation of 1. We then create a linear model that predicts the outcome value based on the feature group norms, and control variables. B0 + B1*F + B2*C1 + B3*C2 + B3*F*I + B4*I = O_pred From this model three rows will be 3 coefficients per feature output into an rmatrix: xxxxx - corresponds to B1 xxxx with yyyyy - corresponds to B4 group_norm * xxxxx from yyyy - corresponds to B3

Other Switches

Required Switches: --outcomes --outcome_table Optional Switches: --group_freq_thresh --outcome_controls Example Commands ================

Using the packaged dla_tutorial dataset (see Differential Language Analysis (DLA) Tutorial): correlates Facebook topics with age, including an interaction term with gender, and controlling for whether the user is a student.

dlatkInterface.py -d dla_tutorial -t msgs -c user_id --group_freq_thresh 500 \
-f 'feat$cat_met_a30_2000_cp_w$msgs$user_id$16to16' \
--outcome_table blog_outcomes \
--outcomes age \
--outcome_interaction gender \
--output_interaction_terms \
--outcome_controls is_student \
--output_name ./fbtopics_age_gender_interaction \
--rmatrix --sort \
--whitelist --feat_whitelist 344 512 621 883 1023