import pandas as pd
from thumb_pearson_r import th_pearson_r

def es_rosenthal(zVal, n, qual="bartz"):
    '''
    Rosenthal Correlation Coefficient
     
    This function will calculate Rosenthal Correlation Coefficient
    
    Parameters
    ----------
    zVal : z-value of test
    n : the sample size
        
    Returns
    -------
    testResults : Pandas dataframe with effect size and classification.
   
    Notes
    -----
    Requires the th_pearson_r function from thumb_pearson_r
    
    Author
    ------
    Made by P. Stikker
    
    Please visit: https://PeterStatistics.com
    
    YouTube channel: https://www.youtube.com/stikpet
    
    '''
    
    r_ros = abs(zVal / (n**0.5))
    qualification = th_pearson_r(r_ros, qual)
    
    testResults = pd.DataFrame([[r_ros, qualification]], columns=["Rosenthal corr.", "Classification"])
        
    pd.set_option('display.max_colwidth', None)
    
    return testResults

#Example
z = 1.143943
n = 20

es_rosenthal(z, n)