Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Readreplace

    Hi everyone,

    I am trying to reconcile two double entry datasets, for which I am using cfout and readreplace commands.

    In my datasets, variable "uniqueid" uniquely identifies the observations.

    The cfout command works out just fine and I am able to outsheet a csv format file which contains the difference in variable values for both the datasets.

    I then manually enter the correct values in a different csv file called "corrected.csv" containing variables "uniqueid" "question" (having the variable names which differ in both datasets" and "correctvalues"

    However, when I use the readreplace command using:

    Code:
    use "form1.dta"
    readreplace using corrected.csv, id(uniqueid) variable(question) value(correctvalue)
    I get the following error:

    Code:
    variable uniqueid_class not found in replacements file
    (error in option id())
    I do not understand why this is happening, because I do have variable "uniqueid" in the replacement file which is the corrected.csv and also in the dataset in the memory "form1"

    Would somebody have an idea as to what is going on?

    I have even tried the readreplace command with import(case) option.

    Thanks!

  • #2
    I'm not familiar with the readreplace command (a user-written package from SSC), but having read the help file, I have an idea.

    I believe the problem is that the variable(s) specified in the id() option need to have exactly the same name in both the master file and the corrections. I think that while your replacement file has the variable "uniqueid" your master file has the variable "uniqueid_class", and so when you specify id(uniqueid) Stata finds that to be an abbreviation for uniqueid_class in your master file, and looks for that in your corrections file.

    But this is just a guess because you tell us very little about your either your master dataset or your corrections file, and certainly don't give us sample data that reproduces the problem. So the only members who can answer your question easily are those who have used readreplace. Those members (and there are more than a few) who are interested in learning new commands to try to help are left with precious little to help them help you.

    Please review the Statalist FAQ linked to from the top of the page, as well as from the Advice on Posting link on the page you used to create your post. Note especially sections 9-12 on how to best pose your question.

    The more you help others understand your problem, the more likely others are to be able to help you solve your problem.

    Comment

    Working...
    X