Agriculture Reference
In-Depth Information
Figure 2.15
Dialog box to convert a dataset from a wide-to-long or long-to-wide format.
In the vernacular of Stata, this dataset is in a wide format and it
needs to be in a long format for the type of analysis we want to make.
This can be accomplished relatively easily by selecting the Convert
data between wide and long submenu (FigureĀ 2.15).
Data > Create or change data > Other variable-transfor-
mation commands > Convert data between wide and long
In order for this to work, the replications have to have a stub name
with a unique ending. In this case, the stub is rep with the unique
endings 1-4. In the ID variable(s) - the i() option: select the entry
variable. In the Subobservation identifier variable - the j() option:
enter num or you can use any variable name you wish, in the Variable:
field, since this command is going to create the variable. Finally, in
the Base (stub) names of X_ij variables: enter rep and then click the
OK button. The num variable is now your replication identifier and
the onion yield variable is labeled rep . You may wish to change these
names to reflect what they are, perhaps rep and yield, respectively, for
the replication and onion yield.
Oftentimes you may have more than one measurement for each
experimental unit. For example, in a watermelon trial, each plot
may have a couple hundred pounds of watermelon that cannot be
weighed all at once. This results in multiple weights for each plot.
Search WWH ::




Custom Search