BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
sas_university
Obsidian | Level 7

i have two variables  first variables is number of teams, second variable is number of times this are two my variables ,

example : i have 10 cricket teams ,10 teams play each other only one time combination , total how many matches is happened , 45 matches is happened . how to calculate on sas.

data ds;

infile datalines ;

input no_of_teams  no_of_times;

cards;

10 1

;

run;

total matches happened 45 how to calculate on sas anyone can help me this logic .

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
FreelanceReinh
Jade | Level 19

Hello @sas_university,

 

You can use the COMB function:

data want;
set ds;
no_of_matches=comb(no_of_teams,2)*no_of_times;
run;

View solution in original post

2 REPLIES 2
FreelanceReinh
Jade | Level 19

Hello @sas_university,

 

You can use the COMB function:

data want;
set ds;
no_of_matches=comb(no_of_teams,2)*no_of_times;
run;

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 880 views
  • 3 likes
  • 2 in conversation