Memuat
Memuat
Pearson and Spearman Correlation for Economics and Finance
0 views
Apply Pearson and Spearman Correlation to synthetic data to test differences in mutual fund returns across fund types adjusted for market volatility and conclude on statistical significance. Pearson correlation measures the strength of the linear relationship between two numeric variables, while Spearman measures a monotonic rank-based relationship. They are used to explore relations among variables before or without a predictive model.

Apply Pearson and Spearman Correlation to synthetic data to test differences in mutual fund returns across fund types adjusted for market volatility and conclude on statistical significance.
| Role | Variable | Unit |
|---|---|---|
| Main | Mutual fund return | % |
| Supporting 1 | Fund type | - |
| Supporting 2 | Market volatility | % |
Correlation between Mutual fund return and Fund type: Pearson r = -0.755 (p < 0.001) and Spearman rho = -0.699; the relationship is negative and strong.
Computed from illustrative synthetic data, not from a real study.
Pearson correlation measures the strength of the linear relationship between two numeric variables, while Spearman measures a monotonic rank-based relationship. They are used to explore relations among variables before or without a predictive model.
Report the coefficient r or rho, p-value, and sample size, then interpret the strength. Remind readers that correlation does not prove causation.
A short starting script with this project's variable names. The delivered version is adapted to your data and fully commented.
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import scipy.stats as st
rng = np.random.default_rng(28)
n = 120
fund_type = rng.normal(10, 2, n)
market_volatility = rng.normal(5, 1, n)
mutual_fund_return = 2 * fund_type + np.exp(0.3 * market_volatility) + rng.normal(0, 2, n)
r, p = st.pearsonr(fund_type, mutual_fund_return)
rho, p2 = st.spearmanr(market_volatility, mutual_fund_return)
print("Pearson X1-Y: r =", round(r, 3), "p =", round(p, 5))
print("Spearman X2-Y: rho =", round(rho, 3), "p =", round(p2, 5))
df = pd.DataFrame({"x1": fund_type, "x2": market_volatility, "y": mutual_fund_return})
corr = df.corr(method="spearman")
print(corr.round(2))
fig, ax = plt.subplots(1, 2, figsize=(10, 4))
ax[0].scatter(fund_type, mutual_fund_return, s=10); ax[0].set_xlabel("x1"); ax[0].set_ylabel("y")
im = ax[1].imshow(corr, vmin=-1, vmax=1, cmap="coolwarm")
ax[1].set_xticks(range(3)); ax[1].set_xticklabels(corr.columns)
ax[1].set_yticks(range(3)); ax[1].set_yticklabels(corr.columns)
plt.colorbar(im, ax=ax[1])
plt.tight_layout()
plt.show()Choose how much help you need. Each higher package includes everything in the lower ones. Prices exclude 11% VAT.
Package 1
US$16
excl. 11% VAT
Duration: 3 working days
Output: Python files + result figures
Deliverables
Package 2 · most chosen
US$47
excl. 11% VAT
Duration: 7 working days
Output: Code + analysis + interpretation notes
Includes all of Package 1, plus
Package 3
US$103
excl. 11% VAT
Duration: 12-15 working days
Output: Code + analysis + guidance until ready to present
Includes all of Packages 1 & 2, plus
Yes. Pearson and Spearman Correlation is commonly used at this level in Economics and Finance. We adapt the analysis to your research question, your own data and your supervisor's requirements.
No. The sheet is computed from illustrative synthetic data so you can see the kind of output Python gives. For your order we run the same method on your own data.
That is the point of the packages. Every script is commented, and Package 3 includes two coaching sessions plus practice questions so you can explain the method and the results at your seminar and defence.
Each project has three packages: Package 1 (code and explanation) US$16, Package 2 (your data analysis and interpretation) US$47 and Package 3 (full guidance) US$103, excluding 11% VAT. Larger datasets, extra methods or tight deadlines adjust the quote after a short consultation.
The result sheet uses illustrative synthetic data. Python is a trademark of the Python Software Foundation.
Back to Python portfolio