user5990859
user5990859

Reputation: 11

How to find syntax for computed variable?

I am utilizing a data set that was created by someone else for a school project. The original owner added together multiple variables to compute new continuous variables (of sums, averages, etc.). I would like to use these computed variables if possible.

Unfortunately, I do not have all the syntax the previous owner used to create those new variables. Having learned statistics in R, I'm very surprised I cannot somehow find the syntax for the variables that were summed to create these new continuous variables.

Is there any way to locate the syntax (variables) that were added, averaged etc. to create the new variables? Or is this a matter of reinventing the wheel?

Upvotes: 1

Views: 151

Answers (2)

JKP
JKP

Reputation: 5417

If you can get the journal file from your colleague, you can get the syntax used from that. The exact syntax can be tricky if there were conditional transformations or variables were overwritten, however.

Upvotes: 1

maxwelldeux
maxwelldeux

Reputation: 160

The base syntax to compute variables is pretty straightforward:

compute variable3 = variable1 + variable 2.
execute.

But without your colleague having saved the syntax somewhere for others to use, you are not going to be able to figure out how those new variables were created.

Upvotes: 1

Related Questions