Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8855771
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T14:12:43+00:00 2026-06-14T14:12:43+00:00

I wanted to test what happened if I replace a variable with a different

  • 0

I wanted to test what happened if I replace a variable with a different data type:

clear
input id x0
1  1
2  13
3  .
end
list
save tabA, replace

clear
input id str5 x0
1  "1"
2  "23"
3  "33"
end
list
save tabB, replace

use tabA, clear
mmerge id using tabB, type(1:1) update replace
list

The result is:

   +--------------------------------------------------+
   | id   x0                                   _merge |
   |--------------------------------------------------|
1. |  1    1   in both, master agrees with using data |
2. |  2   13   in both, master agrees with using data |
3. |  3    .   in both, master agrees with using data |
   +--------------------------------------------------+

This seems very strange to me. I expected breakdown or disagreement. Is this a bug or am I missing something?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T14:12:44+00:00Added an answer on June 14, 2026 at 2:12 pm

    mmerge is user-written (Jeroen Weesie, SSC, 2002).

    If you use the official merge in an up-to-date Stata, you will get what you expect.

    . merge 1:1 id using tabB, update replace
    x0 is str5 in using data
    r(106);
    

    I have not looked inside mmerge. My own guess is that what you see is a feature from the author’s point of view, namely that it’s not a problem if one variable is numeric and one variable is string so long as their contents agree. But why are you not using merge directly? There was a brief period several years ago when mmerge had some advantages over merge, but that’s long past. BTW, I agree in wanting my merges to be very conservative and not indulgent on variable types.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

simple example in Notepad++ using RegEx replace search for: anything replace with (wanted): \test
I wanted to test the following code (which works fine for a non-null list)
While reading this question I wanted to test the input in GCC to see
I wanted to test out some different coloured cells in my iPhone App, and
I recently started creating apps for android and wanted to test layouts for different
I wanted to log what happened with my Django app on my test server
I wanted to test how C++ behaves when the return value of a function
Out of curiosity I wanted to test the number of ticks to compare a
I set up a new webapp Maven project and wanted to test it with
Hi I've been writing a chat client and wanted to test the Java Sound

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.