This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* freq procedure with multiple variables */ | |
proc freq data=hgrosser; | |
tables GENRE MOVIE; | |
run; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from IPython.display import display | |
def multiFreq(dataset, variable_list): | |
for i in variable_list: | |
datax = dataset[f'{i}'].value_counts() | |
datay = pd.DataFrame({ | |
f'{i}': datax.index, | |
'Frequency': datax.values, | |
'Percent': ((datax.values/datax.values.sum())*100).round(2), | |
'Cumulative Frequency': datax.values.cumsum(), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
title "Simple proc means"; | |
/* Simple proc means */ | |
PROC MEANS DATA=SASHELP.CARS; | |
RUN; | |
title "Select the required variables & drop the labels"; | |
/* Select the variables & drop the labels */ | |
PROC MEANS DATA=SASHELP.CARS nolabels; | |
var |
OlderNewer