BookmarkSubscribeRSS Feed
meab
Calcite | Level 5

Hi All,

I need help with creating the dummy data for lborres variable using the attached document.

 

To create the dummy data for lborres below are the rules.

For lab tests with numeric result and character (TESTNAME in Test1):
1) Set non-missing lborres as blank.
2) Generate random lborres values between minimum and maximum values of unblinded ‘LBORRES’. Make sure the maximum length of LBORRES (dummy) in blinded data is same as in unblinded data.
3) If unblinded ‘LBORRES’ contains ‘<xxx’ or ‘>xxx’, randomly assign from 5% -10% blinded ‘LBORRES’ as ‘<xxx’ or ‘>xxx’.
4) If unblinded ‘LBORRES’ contains other special marks or text with no digits (if applicable), randomly assign from 5% -10% blinded ‘LBORRES’ as the special marks or text.
5) Concatenate blinded dataset for all the combinations of lab test.

For lab tests with character result (TESTNAME equal Test2):
1) Set non-missing ‘LBORRES’ as blank.
2) Generate random ‘LBORRES’ values of ‘negative’ or ‘positive’. Make sure the maximum length of LBORRES (dummy) in blinded data is same as in unblinded data.

i didn't used rand function much, i tried some ways it didn't worked. Can you please help with this one.

 

Thank You.

 

Regards,

Bhavani.

4 REPLIES 4
PaigeMiller
Diamond | Level 26

Please show us what you have tried so far.

 

Also, most of us will not accept data in Excel files, we need data presented as working SAS data step code, which you can type in yourself or follow these instructions.


And I don't understand any of the steps you have there, starting with this one:

"1) Set non-missing lborres as blank."

 

Makes no sense to me. So please explain this one (and all the others as well) and show us the code you have tried. What does any of this have to do with dummy variables, which are mentioned in your title and some places in your text, but the instructions of the 5 steps don't seem to be creating dummy variables.

--
Paige Miller
meab
Calcite | Level 5

added the code to attachment.

meab
Calcite | Level 5

need to replace the data is LBORRES field with dummy data. the rules for creating the dummy data in specified in my first post.

PaigeMiller
Diamond | Level 26

As I (and many others) will not or cannot download attachments, please post the code in your reply by copying and pasting the code into the window that appears when you click on the "Little running man" icon. Also, please provide a portion of your data as I explained.

--
Paige Miller

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!

Submit your idea!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 4 replies
  • 735 views
  • 0 likes
  • 2 in conversation