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

Hi, i have a dataset with people rolling a dice, and i need to label them with a game number

I have a varible called trialCount. This goes from 1 to 13, and everytime it equals one, its a new game number.

Basically this is the stucture i have - except for game number:

trialCount     totalTrialCount     gamenumber (Dont have, but want!)

     1                    1                         1

     2                    2                         1

     3                    3                         1

     4                    4                         1

     1                    5                         2

     2                    6                         2

     1                    7                         3

     1                    8                         4

     1                    9                         5

     2                    10                       5

     3                    .                         5

     4                    .                         .

     5                                              .

     6

     7

     .

     .    

So basically what i would like is something conceptually like:

When trialcount = 1

then gamenumber = "some loop that counts what game number we are at, and puts that number in"

until trialcount = 1 again, then start over

I can't really work this out. I can do a simple count + 1, first.count, but that dosen't really work here.

Hope you understand where im coming from!

Thanks

toby

1 ACCEPTED SOLUTION

Accepted Solutions
art297
Opal | Level 21

why not just?:

if trialCount eq 1 then GameNumber+1;

View solution in original post

3 REPLIES 3
art297
Opal | Level 21

why not just?:

if trialCount eq 1 then GameNumber+1;

Haikuo
Onyx | Level 15

Exactly, or equally:

Gamenumber+(trialCount eq 1) ;

Haikuo

TMorville
Calcite | Level 5

God i think i had too much coffee this evening.

Thanks for pointing out the obvious.

T

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 3 replies
  • 904 views
  • 3 likes
  • 3 in conversation