I have an issue with the append command.
I have a couple of stata files that contain three variables: File, Location and Document.
I created these variables by working with Wordstat in Stata. I want to analyse different textfiles regarding key word frequencies (with egen noccur) at once. Wordstat can create stata files that contain the whole text of a text file as an observation within the variable Document.
The variable File contains the name of the file, the varibale Location the name of the folder and the variable Document is different for each file and contains the particular text.
I have stored the text files in 20 different stata files because the converting to a stata file with wordstat needed 1 hour for each stata file and thus it is not really possible to load all text files at once with wordstat. I knew the append command and that it should work.
However, when I use one of these stata files, containing the three variables and I use append using one of the other stata files I receive
(label FILE_lst already defined)
(label LOCATION_lst already defined)
Plus, observations are added that contain the new text files that have been appended with the new stata file, but only the Document variable is containing the correct information, the text from the different particular files. The location variable of the stata file used for apppending is different but it receives the same name as the first used stata file. The same is for the File variable. There a number is used as file name or another wrong file name. Thus, the information of File and Location for the new appended observations is incorrect.
The label for the variables File and Location are in both stata files the same: Type long, Value label: FILE_Ist or LOCATION_Ist. DOCUMENT has Type: strL and Value Label: no value / is empty
I use the file variable as a identifier to merge the statafile with a master statafile afterwards that contains panel data. So it is necessary to have File variable and Document variable correctly for each observation. The Location variable is not that important.
How can I solve the issue?
Related Posts with Append command changes the content of observations of the appended file
Gen total var for profitability from one year before to two years after given dateDear all, I am trying to sum the profitability of a given target firm for the period year-1 to year…
Date lable of twoway graphHi together, i use stata 16.0 and have a panel data set including banks (unique identifier is the…
Some important statistics at the bottom of x axisI want some statistics that correspond to x-axis and I want the Y axis value to be computed and appe…
count if variables meet conditionsHello everyone, I have a data on average sales of corporation for the past 6 months. Below you can s…
How to loop on all CSV files in several folders and create a separate dta filesHi , I am wondering How to loop on all CSV files in several folders and create a separate dta files …
Subscribe to:
Post Comments (Atom)
0 Response to Append command changes the content of observations of the appended file
Post a Comment