BookmarkSubscribeRSS Feed
robertrao
Quartz | Level 8

I am merging these two tables.and i am getting table3

in most cases table 1 has many observations than table2 for the same ID

is it OK to merge even if the table 1 has less records for the same ID than table2?????

the result in table 3 is in a format i wanted......can i ignore the NOTE????


table1                                         table2

ID     charges                           ID    Trials

101                                         101     22

101                                         101    25

101                                         101    23

101                                         102   10

101                                         102   11

101

101

101

101

101

101

102

102

102

102

table3

ID     charges   Trials

101                     22                  

101                     25                                  

101                     23                                 

101                    23       -----23 spans till the next ID.BUT THAT IS ALSO FINE WITH ME

101                    23

101                    23

101                   23

101                   23

101                  23

101                 23

101                 23

102                 10

102                 11  ---spans

102                  11

102                 11

I get a message that merge has more than one dataset with repeats of BY variables

1 REPLY 1
LinusH
Tourmaline | Level 20

The NOTE is there because in most scenarios, you don't want that result, it is unpredictable.

And the same here, why is it ok to repeat the value of the last trail for each ID? What is it you really want...?

Data never sleeps

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 664 views
  • 0 likes
  • 2 in conversation