BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
zimcom
Pyrite | Level 9

Greetings!

 

I want to apply the following calculated mean + 1 SD and mean + 2 SD to another dataset 

variablesa_SD1a_SD2b_SD1b_SD2c_SD1c_SD2d_SD1d_SD2
level..1.20591.5366....
score1.09511.584......
SAE....1.36452.2222..
PD......2.58323.9519

 

and get a dataset like below:

100101MAR17:12:52:00Placeboa_SD1a_SD2b_SD1b_SD2c_SD1c_SD2d_SD1d_SD2
100201MAR17:13:33:00Active1.095121.58391.205851.536591.364512.222232.583183.95188
100307MAR17:22:20:00Placebo1.095121.58391.205851.536591.364512.222232.583183.95188
100419MAR17:09:39:00Active1.095121.58391.205851.536591.364512.222232.583183.95188
100512APR17:11:54:00Active1.095121.58391.205851.536591.364512.222232.583183.95188
100626APR17:14:46:00Placebo1.095121.58391.205851.536591.364512.222232.583183.95188
100726MAY17:12:45:00Active1.095121.58391.205851.536591.364512.222232.583183.95188
100827MAY17:12:12:00Placebo1.095121.58391.205851.536591.364512.222232.583183.95188
100912JUN17:12:53:00Active1.095121.58391.205851.536591.364512.222232.583183.95188
101028JUN17:18:42:00Placebo1.095121.58391.205851.536591.364512.222232.583183.95188
101129JUN17:15:01:00Active1.095121.58391.205851.536591.364512.222232.583183.95188
101216SEP17:21:21:00Placebo1.095121.58391.205851.536591.364512.222232.583183.95188
101317SEP17:12:50:00Placebo1.095121.58391.205851.536591.364512.222232.583183.95188
101401MAR17:12:52:01Active1.095121.58391.205851.536591.364512.222232.583183.95188
101501MAR17:13:33:01Active1.095121.58391.205851.536591.364512.222232.583183.95188
101607MAR17:22:20:01Placebo1.095121.58391.205851.536591.364512.222232.583183.95188
101719MAR17:09:39:01Active1.095121.58391.205851.536591.364512.222232.583183.95188
101812APR17:11:54:01Placebo1.095121.58391.205851.536591.364512.222232.583183.95188
101926APR17:14:46:01Active1.095121.58391.205851.536591.364512.222232.583183.95188
102026MAY17:12:45:01Placebo1.095121.58391.205851.536591.364512.222232.583183.95188
102127MAY17:12:12:01Active1.095121.58391.205851.536591.364512.222232.583183.95188
102212JUN17:12:53:01Placebo1.095121.58391.205851.536591.364512.222232.583183.95188
102328JUN17:18:42:01Placebo1.095121.58391.205851.536591.364512.222232.583183.95188
102429JUN17:15:01:01Active1.095121.58391.205851.536591.364512.222232.583183.95188
102516SEP17:21:21:01Active1.095121.58391.205851.536591.364512.222232.583183.95188
102617SEP17:12:50:01Placebo1.095121.58391.205851.536591.364512.222232.583183.95188
102701MAR17:12:52:02Active1.095121.58391.205851.536591.364512.222232.583183.95188
102801MAR17:13:33:02Placebo1.095121.58391.205851.536591.364512.222232.583183.95188
102907MAR17:22:20:02Active1.095121.58391.205851.536591.364512.222232.583183.95188
103019MAR17:09:39:02Placebo1.095121.58391.205851.536591.364512.222232.583183.95188

 

Thanks as always!!

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User
Please check the link on my second post then.

View solution in original post

7 REPLIES 7
Reeza
Super User
What's the logic? Can you simplify this and create a fully worked example that shows the exact input and expected output?
I can see the values are filled down, so are you actually expecting all the values to be exactly the same regardless of date and whatever the variables are in the second table. Where did the times and placebo variables come from? What's the logic there? Your example will help answer these questions.
zimcom
Pyrite | Level 9
Yes, I am expecting all the values to be exactly the same regardless of date and whatever the variables are in the second table.

Where did the times and placebo variables come from?
the times and placebo variables come from another table
Reeza
Super User

Alright, then use the if _n_=1 then set trick.

zimcom
Pyrite | Level 9
Could you please elaborate more on the coding part?
Thanks!!
Reeza
Super User
Could you please provide a full example as requested to ensure your problem is clear and the answer provided is correct. There's a linked example that shows how it works in general.
zimcom
Pyrite | Level 9
Basically I have a demographic dataset with 4 numeric variables which I calculated the mean and SD separetly. now I need to merge back the mean + 1SD and mean + 2SD back to the demographic dataset so that I can cross check if the 4 numeric variables is higher or lower compared with the mean + 1SD and mean + 2SD.

So that is why I need to put all the values to be exactly the same regardless of date and whatever the variables are in the second table.
Hope this helps.

Thanks
Reeza
Super User
Please check the link on my second post then.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

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
  • 7 replies
  • 841 views
  • 1 like
  • 2 in conversation