Data source: Investment Questionnaire
Dataset Owner: Suryansh Agrawal, Kazi Nafs, Brian Vap
Original data collectors: Suryansh Agrawal, Kazi Nafs, Brian Vap
Data Collection Questionnaire: Questionnaire
Data size: 8,129 bytes (8 KB on disk)
To download the data set (updated) : Click Here
We believe that investing early on in life is one of the best ways to achieve financial independence later on in your career. Well-thought-out investments allow people to have more financial security making them prone to financial shocks in the market such as inflation or recession. Statistically, there is a huge difference in the average savings of people who invest in their 20s as opposed to later on in their lives.
The main objective of this research is to analyze the investments trends in young adults and infer how valuable early investing can be.
The dataset was majorly collected from two countries, United States and India. The data was collected using a Google Form and has been kept anonnymus by informing respondesnts of the use of their information.
# Reading Data Set
investment_df <- read.csv("/Users/suryanshagrawal/Dropbox (HIP Investor)/Mac (2)/Desktop/Classes/MATH 220/DA 220 Final Project/DA 220 Final Project/DataBase.csv")
investment_df
| Variable Name | Questionnaire Question | Data Type | Description |
|---|---|---|---|
| timestamp | Timestamp | Continous Variable | The time the respondent submitted the questionnaire. |
| age | How old are you? | Continous Variable | Age of the respondent. |
| where_from | Where are you from? (Please mention state if from United States) | Nominal Variable | The place where the respondent is from (most respondent responded the place they are in currently, and not from where they were born. |
| do_you_invest | Do you invest in the financial market? | Nominal Variable | Yes/No question to if the respondent invest. The further questionnaire was dependent on this answer. They were asked more questions if they responded yes, and less questions if they did not invest. |
| how_much_monthly | How much money do you invest monthly? (Dollar Amount) | Continous Variable | The amout in $ the respondent invested monthly. |
| markets | What kinds of financial assets do you invest in? | Ordinal Variable | A bunch of options were given and they could select all the applicable options in the type of markets the respondent invested in. |
| portion | What portion of your income do you invest? | Ordinal Variable | On a monthly basis, the portion of money they invested in. |
| how_long | How long have you been investing in financial markets? | Discrete Variable | In years, the number of years they have been investing. |
| financial_health | How would you rate your financial health on a scale of 1 to 5 | Continous Variable | Checking what our respondents think of their own financial health on a scale of 1 to 5 |
| international_markets | Do you or would you invest in a financial market outside the US? | Nominal Variable | Yes/No question to if the respondent would invest in international markets. |
Making a data set for the respondents who
invest.
# Respondents who invest
respondents_who_invest <- investment_df[investment_df$do_you_invest=='Yes',]
respondents_who_invest
Below is the quick summary of our data set in a descriptive
statistical manner The table shows each of our data point and its
summary statistic involving central and
variability statistic
Here’s how to interpret each value in the output:
vars: column numbern: Number of valid casesmean: The mean valuesd: The standard deviation of the datamedian: The median valuetrimmed: The trimmed mean (default trims 10% of
observations from each end)mad: The median absolute deviation (from the
median)min: The minimum valuemax: The maximum valuerange: The range of values (max – min)skew: The skewnesskurtosis: The kurtosisse: The standard errorIQR: The interquitle rangedescribe(investment_df, quant = T)
describe(respondents_who_invest, quant = T)
Variables that are categorical or logical are converted to numeric and then described. These variables are marked with an * in the row name.
The respondents who said yes to investing, the following is the age distribution.
pie_df = as.data.frame(table(respondents_who_invest$age))
lbls = c(18:25)
lbls
## [1] 18 19 20 21 22 23 24 25
pie(pie_df$Freq, labels = lbls, main = "Age demographic of respondents who invested")
This is valuable to note as this proves that the research question which is supposed to be catered to young adults is factual and we are conducting our research on ages 18 to 25.
To visualize the markets our respondents invest in, we drew a bar chart. Here, each bar represents the number of respondents that invest in each of these markets.
import pandas as pd
import matplotlib.pyplot as plt
df = pd.read_csv('DataBase.csv')
l = []
for i in df['markets'].dropna():
for items in i.strip().split(','):
items = items.strip()
l.append(items)
from collections import Counter
dictionary = dict(Counter(l))
plt.barh(list(dictionary.keys()), dictionary.values(), color='k')
## <BarContainer object of 12 artists>
plt.title('Types of Financail Markets', loc = "center")
plt.show()
As we can see, the most popular type of market our respondents invest
in is the Stock Market, which also aligns with the study conducted by
Jitanchandra Solanki in his
Admirals
Market report. More popular markets consist of cryptocurrency market
and mutual funds market.
To compare the income proportions and monthly investment, we drew a box plot.
ggplot(respondents_who_invest, aes(portion, how_much_monthly)) +
geom_boxplot(outlier.color="black") +
labs(title="Proportion of Income and Monthly Investment",
x="Proportion of Income",
y="Monthly Investment") + theme_economist()
This box plot of the respondents_who_invest data set
shows the distributions of income proportion and monthly investment
across the six different kinds of proportion in the data.
10% to 20% have medians and interquartile ranges well below
the other proportions, suggesting a statistically significant
difference. It also have a nearly identical IQR and median to
Below 10%, as evidenced by the proportion of income, though
there are a handful of outliers in these groups. Above 50%
have a larger interquartile range than any of the other groups, which
suggests greater variability in their investment distribution. Overall
the graph suggests that larger proportion tend to have higher investment
distributions, while smaller proportion seem less.
According to “College Finance”, 52% of college students have some sort of an investment account. Our sample data set suggests the percentage should be lower. Our hypothesis test will verify that.
H0: p=.52
Ha: p<.52
Proportion we found = .42
z-score= -3.149
P-value = .0003
Alpha = 0.01
H0 rejected
We rejected the null hypothesis which mean, there is enough evidence in our hypothesis that p is not equal to 52%.
According to CNBC, people with good financial health will have started investing around 240$ each month before 25 years of age. We want to test if the hypothesis is accurate. Our average for healthy-rated investors is 305.534
H0: hv=240
ha: hv≄240
mean = 305.53
t-score= 1.13
n=45, df=44 (People who rated themselves ≥4)
p-value= .138
Alpha = 0.05
H0 failed to reject
We failed to reject H0 which says the mean amount of investing is around $240.
According to CNBC, to become a millionaire by age 65, you only need to invest $240 each month. The average amount invested each month by those whom we surveyed was $292.48. The standard deviation is 376.45, and the number of people who said that they invest is 63. We conducted a 95% confidence interval for the proportion of students who invest enough each month in order to reach this goal.
cor.test(respondents_who_invest$how_much_monthly, respondents_who_invest$age)
##
## Pearson's product-moment correlation
##
## data: respondents_who_invest$how_much_monthly and respondents_who_invest$age
## t = 1.0095, df = 61, p-value = 0.3167
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
## -0.1235051 0.3643752
## sample estimates:
## cor
## 0.1281824
The correlation test and confidence interval test suggests a weak negative correlation between age and mow much monthly investmemnt (p=0.3167, t=1.0095, df=61). This makes sense because it is likely that as age increases, monthly ivestment would increase, and because the points on the scatter plot appear to have a upward slope. The true correlation is suggested to fall between -0.1235051 and 0.3643752, a relatively narrow range that’s pretty close to 0. The true Pearson’s correlation coefficient for these two variables was 0.128. The result is statistically significant, and it’s likely to be practically significant as well: 0.128 is a fairly weak positive correlation with the mean of investment confidence interval of (199.52, 385.44)
Now we will look at a linear regression to prove a linear relation
between and predict future values between our two variables,
age and monthly investment.
Finding a correlation between both these variables:
residual_plot = data.frame(age = respondents_who_invest$age, how_much_monthly = respondents_who_invest$how_much_monthly)
cor(residual_plot$age, residual_plot$how_much_monthly)
## [1] 0.1281824
As we can see, both of these variables have a week correlation so
expect to see a small sloped linear regression and it shows that both of
these variables are not correlated. To elaborate further,
age is not related to monlthy investment. Our
team’s prediction was, as the age grows, the monthly investment should
also grow. This is still true as the corelation is positive.
Making a qplot of both of these variables to see the relation between these variables and also making a line of best fit (linear regression) to see the predicted values in the long run for the ages not in our data set.
qplot(residual_plot$age, residual_plot$how_much_monthly) + geom_smooth(method = "lm", se = F) + theme_economist()
## `geom_smooth()` using formula 'y ~ x'
model = lm(how_much_monthly ~ age, data = residual_plot)
summary(model)
##
## Call:
## lm(formula = how_much_monthly ~ age, data = residual_plot)
##
## Residuals:
## Min 1Q Median 3Q Max
## -362.1 -224.8 -147.3 117.7 1752.7
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -226.94 516.73 -0.439 0.662
## age 24.96 24.73 1.009 0.317
##
## Residual standard error: 376.4 on 61 degrees of freedom
## Multiple R-squared: 0.01643, Adjusted R-squared: 0.0003066
## F-statistic: 1.019 on 1 and 61 DF, p-value: 0.3167
From the summary, we see the x and the y intercept which will help us plot the linear regresion equation y = 24.96054x -226.94081
The next block will show the fitted values (or predicted) of each our data entry according to the linear regression
fitted.values(model)
## 1 2 3 4 5 6 7 8
## 247.3095 247.3095 247.3095 272.2700 247.3095 297.2306 272.2700 247.3095
## 9 10 11 12 13 14 15 16
## 347.1517 297.2306 272.2700 322.1911 247.3095 272.2700 272.2700 372.1122
## 17 18 19 20 21 22 23 24
## 322.1911 272.2700 272.2700 372.1122 272.2700 247.3095 222.3490 222.3490
## 25 26 27 28 29 30 31 32
## 347.1517 397.0727 247.3095 347.1517 372.1122 372.1122 272.2700 297.2306
## 33 34 35 36 37 38 39 40
## 372.1122 322.1911 347.1517 322.1911 222.3490 272.2700 247.3095 247.3095
## 41 42 43 44 45 46 47 48
## 347.1517 272.2700 247.3095 222.3490 297.2306 247.3095 272.2700 322.1911
## 49 50 51 52 53 54 55 56
## 372.1122 322.1911 222.3490 347.1517 347.1517 322.1911 272.2700 297.2306
## 57 58 59 60 61 62 63
## 347.1517 272.2700 247.3095 347.1517 297.2306 222.3490 272.2700
residual_plot$predicted = fitted.values(model)
Similarly, making the next block will show us the residual values of each our data point
residuals(model)
## 1 2 3 4 5 6 7
## 52.69051 -227.30949 -147.30949 727.72996 752.69051 202.76942 227.72996
## 8 9 10 11 12 13 14
## 252.69051 652.84834 -297.23058 -172.27004 -252.19112 -147.30949 -122.27004
## 15 16 17 18 19 20 21
## -147.27004 -362.11221 -272.19112 -72.27004 -172.27004 -247.11221 727.72996
## 22 23 24 25 26 27 28
## 1752.69051 -160.34895 -210.34895 -47.15166 602.92725 -147.30949 -247.15166
## 29 30 31 32 33 34 35
## 327.88779 -322.11221 -272.27004 2.76942 627.88779 77.80888 -342.15166
## 36 37 38 39 40 41 42
## -222.19112 -202.34895 127.72996 -185.30949 -47.30949 652.84834 -222.27004
## 43 44 45 46 47 48 49
## -47.30949 -122.34895 -277.23058 -197.30949 127.72996 177.80888 -362.11221
## 50 51 52 53 54 55 56
## -272.19112 -172.34895 -247.15166 -322.15166 -272.19112 -152.27004 2.76942
## 57 58 59 60 61 62 63
## -97.15166 107.72996 -87.30949 152.84834 -197.23058 -172.34895 -72.27004
residual_plot$residulas = residuals(model)
Plotting predicted values and residual values to prove linear regression
qplot(fitted.values(model), residuals(model)) + geom_smooth(method = "lm", se = F) + theme_economist()
## `geom_smooth()` using formula 'y ~ x'
The line with a slope zero on the predicted values and residual values proves a linear relationship between age and monthly investment. However, this relationship is in a weak correlation and this is not an accurate presumption because of the small sample size, but we were successful in proving a linear relationship as the residual plot has a line of best fit with slope zero.
As we can see the below box plot
ggplot(respondents_who_invest, aes(financial_health_text, how_much_monthly)) +
geom_boxplot(outlier.color="black") +
labs(title="Financial Health Rating and Monthly Investment",
x="Financial Health Rating",
y="Monthly Investment") + theme_economist()
it shows that the people who gave them a rating of 4 and 5 on the financial health metric on a scale of 1 to 5 where 5 meant better stability and 1 meant financial burden, people who invested more are likely to fell more financially secure. It is also true from our statistical inferences that they are likely to become millionaires which will give them financial independence. To show the relationship between what experts suggest and our investors think of their financial health, we have this boxplot suggesting the range (from our confidence interval test) of monthly investment among most of our 4 and 5 rated investors aligning with the suggested number (before 25 years of age)
We cannot fully rely on the results as they are from a small sample size and a few biases may be included as some of the respondents may have financial support from their guardians or parents and that might change their financial health rating. Our majority respondents are from India and USA which are two vatly different countries financially.
Most of our responses were recorded in these regions. While we did not find corresponding variables that could be correlated with investing habits, we are intrigued to learn more about how geographic location attributes to investing habits and can be taken as a future research consideration
US Map of respondents which can be used for future research
Guidance: Dr. Cemile Kurkoglu