# preparing/scoring dataset

#### CorineSlab

##### New Member
Dear all,

I really hope that somebody can help me out. I need to run a factoranalyse on two different scales (Regulatory focus and regulatory mode) at the bottom you can read how the scoring of the data should be done. Is there somebody who can explain me how I interpret these formula and how I execute this in STATA? thank you! kind regards Corine

Regulatory Focus Questionnaire:
COMPUTE promote = (6 - resp_1) + resp_3 + resp_7 + (6 - resp_9) + resp_10 + (6 - resp_11).
COMPUTE prevent = (6 - resp_2) + (6 - resp_4) + resp_5 + (6 - resp_6) + (6 - resp_8).
EXECUTE.
Regulatory Mode:
COMPUTE assess = ((7-resp_2) + resp_6 + resp_7 + resp_9 + (7-resp_10) + resp_11 + resp_15 +
resp_19 + resp_20 + resp_22 + (7-resp_27) + resp_30) / 12 .
COMPUTE locomote = (resp_1 + resp_3 + resp_4 + resp_5 + resp_8 + (7-resp_13) + resp_16 +
resp_21 + (7-resp_24) + resp_25 + resp_28 + resp_29) / 12 .
COMPUTE lie = (resp_12 + resp_14 + resp_17 + resp_18 + resp_23 + resp_26) / 6 .
EXECUTE .

#### maartenbuis

##### TS Contributor
The code you have given us is from SPSS not Stata. It also has nothing to do with factor analysis. The top two variables you are just computing a sum of variables, probably while taking care that the coding of each variable is in the same direction, so in each variable a higher number means higher focus (or lower, there is no way for us to know based on the code alone). The bottom three variables are similar but just averages.

So I would consider carefully whether whether this technique does what you think it does. If you think this is what you want to do, then I will encourage you to use totals instead of averages: The averages are popular, but the coefficients of the totals after including them in a model are actually easier to interpret: http://maartenbuis.nl/publications/sum_constr.html

A direct translation of the code you have given us to Stata would be:

Code:
// Regulatory Focus Questionnaire:
generate promote  = (6 - resp_1) + resp_3 + resp_7 + (6 - resp_9) + resp_10 + (6 - resp_11)
generate prevent  = (6 - resp_2) + (6 - resp_4) + resp_5 + (6 - resp_6) + (6 - resp_8)

// Regulatory Mode:
generate assess   = ((7-resp_2) + resp_6 + resp_7 + resp_9 + (7-resp_10) + resp_11 + resp_15 + ///
resp_19 + resp_20 + resp_22 + (7-resp_27) + resp_30) / 12
generate locomote = (resp_1 + resp_3 + resp_4 + resp_5 + resp_8 + (7-resp_13) + resp_16 + ///
resp_21 + (7-resp_24) + resp_25 + resp_28 + resp_29) / 12
generate lie      = (resp_12 + resp_14 + resp_17 + resp_18 + resp_23 + resp_26) / 6
So, generate is the Stata equivalent of compute. In Stata commands do not end with a ., so if you want to break lines you need to do something else: you can use /// to do that. In Stata there is no need for the execute command. I assumed you included "regulatory foucs questionair" and "regulatory mode" as comments. In Stata you can use // to so.