<jupyter_start><jupyter_text>cited works<jupyter_code>database_name = "sociology-wos"
dtype = 'c'
# Parameters
database_name = "sociology-jstor"
dtype = "t"

cits = get_cnt("%s.ind"%database_name, [comb(dtype,'fy'),'fy',dtype])
cysum = load_variable("%s.%s.ysum"%(database_name,dtype))
cc = Counter(int(x['total']) for _,x in cysum.items())
counts = []
totals = range(0,max(cc.keys())+1)
for i in totals:
    counts.append(cc[i])
# more than 5 times
print("%0.2f%% were cited more than 5 times" % (100 * sum(counts[i] for i in totals if i>5)/np.sum(totals)))
counts = np.array(counts)
totals = np.array(totals)
plt.plot(np.log10(totals),np.log10(counts))
xlab = np.array([1,2,3])
plt.xticks(
    xlab,
    np.power(10, xlab)
)
ylab = np.array([1,2,3,4,5])
plt.yticks(
    ylab,
    np.power(10, ylab)
)

plt.ylabel("Number of citations")
plt.ylabel("Number of cited works")
title = "Received citations distribution (%s, %s)" % (database_name,dtype)
plt.title(title)

save_figure(title)
import statsmodels.api as sm
CUTOFF = 10
lt,lc = [x for i,x in enumerate(totals) if (totals[i]>CUTOFF and counts[i]>0)], [x for i,x in enumerate(counts) if (totals[i]>CUTOFF and counts[i]>0)]
lt,lc = np.log(lt),np.log(lc)

X = sm.add_constant(lt)
y = lc

mod = sm.OLS(y,X)
res = mod.fit()
res.summary()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.18816388467374812, 'fraction_numerical': 0.02276176024279211, 'mean_word_length': 5.497536945812808, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 10, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '561685', 'license': 'MIT', 'n_tokens_mistral': 585, 'n_tokens_neox': 565, 'n_words': 117, 'path': 'knowknow/analyses/ubiquitous power-law behavior.ipynb', 'repo_name': 'adnanjmi21/knowknow', 'size': '1318'}