BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
SAS-questioner
Obsidian | Level 7

Thank you for reviewing my questions, I am really stuck in here.

I have a set of data that I have 64 conditions and 500 replications for each condition. However, some conditions have less than 500 replications, and it is hard for me to identify the conditions with less than 500 replications and how many are missing because there is no missing values (such as "." or blank) in replications. For example, the rep is like this: 1, 2, 4, 5, 8, 9, 10, ......., 500. (After 2, the replications directly jump to 4, and after 5, the replications directly jump to 😎

Could anyone tell me how to identify the conditions with less than 500 replications and how many of replications are missing for each condition? Thank you!! The data format is like below:

var1  var2  var3  var4 rep

  a        b      c       d       1

  a        b      c       d       2

  a        b      c       d       4

  a        b      c       d       5

  a        b      c       d       6

               ......

  a        b      c       d       500

  a        b      c       e       1

  a        b      c       e       2

              .....                 

  a        b      c       e       500

  a        b      f       d         1

  a        b      f       d         3

                 ......

  a        b      f       d         500

;

The var1, var2,  var3, and var4 are manipulated design factors, the different combination of design factors is one condition, and each condition has 500 reps. (like the combination of 'a,b,c,d' is condition 1, 'a,b,c,e' is condition 2, etc., ) Hopefully I made my questions clear. Thank you again!!

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User
proc freq data=have;
table var1*var2*var3*var4 / list out=counts;
run;

data not500;
set counts;
where COUNT ne 500;
MissingObs = 500 - COUNT; run;

Assuming VAR1-VAR4 are constant for each set of REPS, then the above will work. 

 

I'm assuming the variable name outputted from proc freq is COUNT but I can't recall the exact name right now. You may need to fix that part.

 


@SAS-questioner wrote:

Thank you for reviewing my questions, I am really stuck in here.

I have a set of data that I have 64 conditions and 500 replications for each condition. However, some conditions have less than 500 replications, and it is hard for me to identify the conditions with less than 500 replications and how many are missing because there is no missing values (such as "." or blank) in replications. For example, the rep is like this: 1, 2, 4, 5, 8, 9, 10, ......., 500. (After 2, the replications directly jump to 4, and after 5, the replications directly jump to 😎

Could anyone tell me how to identify the conditions with less than 500 replications and how many of replications are missing for each condition? Thank you!! The data format is like below:

var1  var2  var3  var4 rep

  a        b      c       d       1

  a        b      c       d       2

  a        b      c       d       4

  a        b      c       d       5

  a        b      c       d       6

               ......

  a        b      c       d       500

  a        b      c       e       1

  a        b      c       e       2

              .....                 

  a        b      c       e       500

  a        b      f       d         1

  a        b      f       d         3

                 ......

  a        b      f       d         500

;

The var1, var2,  var3, and var4 are manipulated design factors, the different combination of design factors is one condition, and each condition has 500 reps. (like the combination of 'a,b,c,d' is condition 1, 'a,b,c,e' is condition 2, etc., ) Hopefully I made my questions clear. Thank you again!!

 

 

 


 

View solution in original post

4 REPLIES 4
Reeza
Super User
proc freq data=have;
table var1*var2*var3*var4 / list out=counts;
run;

data not500;
set counts;
where COUNT ne 500;
MissingObs = 500 - COUNT; run;

Assuming VAR1-VAR4 are constant for each set of REPS, then the above will work. 

 

I'm assuming the variable name outputted from proc freq is COUNT but I can't recall the exact name right now. You may need to fix that part.

 


@SAS-questioner wrote:

Thank you for reviewing my questions, I am really stuck in here.

I have a set of data that I have 64 conditions and 500 replications for each condition. However, some conditions have less than 500 replications, and it is hard for me to identify the conditions with less than 500 replications and how many are missing because there is no missing values (such as "." or blank) in replications. For example, the rep is like this: 1, 2, 4, 5, 8, 9, 10, ......., 500. (After 2, the replications directly jump to 4, and after 5, the replications directly jump to 😎

Could anyone tell me how to identify the conditions with less than 500 replications and how many of replications are missing for each condition? Thank you!! The data format is like below:

var1  var2  var3  var4 rep

  a        b      c       d       1

  a        b      c       d       2

  a        b      c       d       4

  a        b      c       d       5

  a        b      c       d       6

               ......

  a        b      c       d       500

  a        b      c       e       1

  a        b      c       e       2

              .....                 

  a        b      c       e       500

  a        b      f       d         1

  a        b      f       d         3

                 ......

  a        b      f       d         500

;

The var1, var2,  var3, and var4 are manipulated design factors, the different combination of design factors is one condition, and each condition has 500 reps. (like the combination of 'a,b,c,d' is condition 1, 'a,b,c,e' is condition 2, etc., ) Hopefully I made my questions clear. Thank you again!!

 

 

 


 

SAS-questioner
Obsidian | Level 7

That works like charm! Thank you!!

ballardw
Super User

Can you show code for how that replication variable was created?

 

 

SAS-questioner
Obsidian | Level 7

Reeza just provided correct solution, but thank you all the same.

SAS INNOVATE 2024

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

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.

Get the $99 certification deal.jpg

 

 

Back in the Classroom!

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

View all other training opportunities.

Discussion stats
  • 4 replies
  • 382 views
  • 0 likes
  • 3 in conversation