-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ieduplicates: issue with variable formats #103
Comments
@kbjarkefur the solution I found for this problem when I was creating the reports was to first convert the variables to string, then create the report. Do you think there's a more efficient way to do this? |
Is it this error message that you get:
I agree that what you suggest is a good solution. To tostring() before generating the report, and to tostring() the variables before merging with the report. I only see one issue, we do not want to return the data set with any modifications to the variables. So we need to be able to revert this. The solutions is probably to make a clone of the variable under a new name. Then the last thing we do is clone it back. Also, I think this error (if it is the error I quoted above) can not be caused in variables listed in keepvar() only in uniquevar(), so that might reduce the work we need to do.
What do you think? |
Since no changes are ever made to the uniquevars through the report, we do not need to keep the clones after we have merged. Something like this.
|
I cannot reproduce this error. I've managed to include both a date variable and a labelled factor without problems, so I will close this issue and we can come back to this if we ever come across this error again. |
When a variable in Stata has a different format than the one that is saved in excel, the commands throws an error saying observations were deleted.
For example, one you have a date variable, it is saved as a string in the excel report, but is a number in Stata, so the command can't match observations. Same happens for labeled variables and missing values. For now, I think the best solution is to make variables that cause this errors strings, but we should find a way to fix this or at least make the help file informative about this possiblity.
The text was updated successfully, but these errors were encountered: