Announcement

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

  • How to get matching results in combination?

    Dear all,
    here is the code:
    Code:
    tempfile using
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input str102 firmName byte stress
    "基于人脸识别技术的企业智能管理集成系统" 3
    "世优(北京)科技有限公司"                      3
    end
    save `using', replace
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input str63 firmName str123 projName byte firmAge
    "三角兽(北京)科技有限公司" "三角兽人工智能语义交互系统"                   1
    "三角兽(北京)科技有限公司" "三角兽人工智能语义交互系统"                   1
    "三角兽(北京)科技有限公司" "三角兽人工智能语义交互系统"                   1
    "三角兽(北京)科技有限公司" "三角兽人工智能语义交互系统"                   1
    "三角兽(北京)科技有限公司" "三角兽人工智能语义交互系统"                   1
    "世优(北京)科技有限公司"    "虚拟角色动画实时制作平台"                      2
    "世优(北京)科技有限公司"    "虚拟角色动画实时制作平台"                      2
    "世优(北京)科技有限公司"    "虚拟角色动画实时制作平台"                      2
    "世优(北京)科技有限公司"    "虚拟角色动画实时制作平台"                      2
    "世优(北京)科技有限公司"    "虚拟角色动画实时制作平台"                      2
    "北京越视科技有限公司"          "基于人脸识别技术的企业智能管理集成系统" 2
    "北京越视科技有限公司"          "基于人脸识别技术的企业智能管理集成系统" 2
    "北京越视科技有限公司"          "基于人脸识别技术的企业智能管理集成系统" 2
    "北京越视科技有限公司"          "基于人脸识别技术的企业智能管理集成系统" 2
    "北京越视科技有限公司"          "基于人脸识别技术的企业智能管理集成系统" 2
    end
    merge m:1 firmName using `using'
    how to get the matching results presented in combination?
    here is data structure of master:
    Click image for larger version

Name:	master1.png
Views:	1
Size:	78.0 KB
ID:	1489040


    here is data structure of using:
    Click image for larger version

Name:	using1.png
Views:	1
Size:	15.1 KB
ID:	1489041


    here is data structure I want:
    Click image for larger version

Name:	combination.png
Views:	1
Size:	57.9 KB
ID:	1489042

  • #2
    I don't understand what you want, or why you would want what you it appears to me that you want.

    The variable stress originates from the using data set. That data set has two different firms. Only one of those firms, the second one, has a matching entry in the master data. So only the observations corresponding to that one will receive a value for stress in the merged result.

    The master data has 3 different firms, of which one matches the using, and the other two do not. You apparently want the value of stress from the matched firm to also be applied to the observations of one of the unmatched firms from the master data but not to the other unmatched firm's. Why? How would you tell somebody which one to extend that matching value to?

    Comment


    • #3
      Thank you, Clyde!
      Actually, the firmName should be responded with correct firm names by respondent, however, some of them responded with their project name by mistake, so I have to use their responded firm name or project name to match the firm's basic information. And quite many of them mixed up the firm name and project name, so correcting the firm name by hand will be a little annoying.

      Comment

      Working...
      X