Find Jobs
Hire Freelancers

R Studio: Analysis of data of stocks in SP500 -- 2

€30-250 EUR

Completed
Posted almost 6 years ago

€30-250 EUR

Paid on delivery
Output: A reproducible code in R + a short .pdf report with commented tables and graphs. The two files should be named STUDENT1ID STUDENT2ID.R and STU- DENT1ID [login to view URL], where STUDENT1ID and STUDENT2ID are student IDs of the members of the group. The files should be uploaded to a designated area in the [login to view URL] website. Project Description: Analysis of data of stocks in SP500. Your tasks are the following. 1. Get the data. First, you should set your individual first and the last date for your data analysis. This is done by [login to view URL](STUDENT1ID) [login to view URL] <- [login to view URL]("2018-03-31") - 365 - sample(1:20,1) [login to view URL](STUDENT2ID) [login to view URL] <- [login to view URL]("2018-03-31") + sample(1:20,1) One possible way to get the data is from the R library BatchGetSymbols and run the following code: library(BatchGetSymbols) [login to view URL] <- GetSP500Stocks() tickers <- [login to view URL]$tickers [login to view URL] <- BatchGetSymbols(tickers = tickers, [login to view URL] = [login to view URL], [login to view URL] = [login to view URL]) The object [login to view URL] has now the data for SP500 stocks. Another possibility is to use a package library(pdfetch) and get the selected data (adjusted close for individual stocks) by calling yahoo <- pdfetch_YAHOO(tickers, fields = "adjclose", from=[login to view URL], to = [login to view URL]) 2. We are interested just in the adjusted closing price value. Organize the data in a table, where rows represent the dates and columns represent the individual stocks. The first column should be the date, the following columns should have a name that correspond to the tickers. It helps that you may get the data using two alternative procedures (and compare the resulting two tables). Clean the data (address missing values if any) and make sure that each entry in the table corresponds to the correct date and the correct ticker. Note that some data entries may be missed in download, or the dates may not be 100% consistent for all tickers. As a part of the exercise, save the corresponding table in a .csv file. 3. Perform a basic mean - variance analysis. From the table of the closing prices, create a table representing log returns. Avoid the use of for loops. Instead, apply vector operations (such as log, diff, apply). Compute the averages and standard deviations for each stock. Properly treat any missing values. Plot a frequency histogram for the averages with a density fit. Add a fit based on normal distribution. Do the same for the standard deviations. Run a command summary on both the vector of the averages and the vector of standard deviations. Plot a graph on (x, y) axis with points representing the standard deviation x and the average y for each stock. Add a ticker name to each point (this can be done by a command textxy from library(calibrate)). 4. Perform a basic CAPM analysis for each stock in your SP500 data. For each stock, run regression lm(y ⇠ x), where y is a vector of returns of a given stock and x is a vector of returns of a given benchmark, in our case the SP500 index. This means in particular that you need to get the values of the index itself (ticker bGSPC) and compute its returns. Make sure that the dates of the returns are consistent, otherwise the data would be shifted and the entire analysis would give irrelevant results. Store the resulting coe cients representing ↵ and for each stock together with the P- value corresponding to the coe cient ↵. Plot the histogram of the vector of betas with the density fit and the fit based on a normal distribution. Identify the stocks at both extremes, the ones with the smallest and the largest betas. Plot the histogram of the vector of alphas with the density fit. Identify the stocks with statistically significant alphas (from the corresponding P-values). Lastly, choose one stock that you find interesting, and plot the joint returns of the stock and the index together with the corresponding regression line.
Project ID: 16947168

About the project

12 proposals
Remote project
Active 6 yrs ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs
Awarded to:
User Avatar
We are a team of industrial and mechanical engineers. We had done more complex finance projects (such as implementing a research article) and we are already working on implementation of HMM and random forest algorithms in Python. We have experience in R, therefore I think we are qualified for this job.
€150 EUR in 3 days
4.9 (8 reviews)
4.3
4.3
12 freelancers are bidding on average €136 EUR for this job
User Avatar
Hello, I can help with you in your project R Studio: Analysis of data of stocks in SP500. I have more than 5 years of experience in Econometrics, R Programming Language, Statistical Analysis, Statistics . We have worked on several similar projects before! We have worked on 300+ Projects. Please check the profile reviews. I can deliver your job with in your deadline. Please ping me for more discussion. I can assure the 100% job satisfaction. Thanks,
€250 EUR in 3 days
4.8 (24 reviews)
5.8
5.8
User Avatar
As an engineer in statistics and applied economics as well as a technician specializing in office computing (Microsoft Office MOS Diploma), I am able, available and ready to do this kind of work easily and quickly and under favorable conditions
€130 EUR in 3 days
5.0 (62 reviews)
5.4
5.4
User Avatar
I read the whole description, thank you first for the clarity of specification. You can visit my profile and note that all the projects I've done were using R. I can do it, but it will be costly that's why I bid with the maximum budget you set. I hope you charge me to do this. I will satisfy your request.
€250 EUR in 5 days
4.9 (28 reviews)
4.9
4.9
User Avatar
Hi, I'm familiarized with R studio analysis. I read the project content and it looks intereseting. I only need data and project instruction/details to start working on it. Regards.
€133 EUR in 7 days
5.0 (6 reviews)
3.6
3.6
User Avatar
A proposal has not yet been provided
€88 EUR in 5 days
4.9 (2 reviews)
2.9
2.9
User Avatar
A proposal has not yet been provided
€88 EUR in 4 days
5.0 (3 reviews)
1.3
1.3
User Avatar
Hi, I can do this work. Individual and hard working person done your work accurately. Waiting your response. Always I do my best & fast with on time delivery for my all clients. Please tell me what you need and how would you like to complete this project. Your project will be 100% accurate and professional. 100% satisfaction guaranteed. Fully clear communication. Continued support after done your project. Please trust me & give the opportunity. I will hope your answer. Send me a message, I’ll respond quickly. Best regards.
€150 EUR in 3 days
0.0 (0 reviews)
0.0
0.0
User Avatar
Hi i am saprative I specialize in designing and architecture high traffic website using django. I have extensive experience in developing django based apps.I did work on Some mechanic learning and BI projects I will be giving you a solution where you can mange the whole process from the admin profile. Your work seems pretty easy project for me. Lets have a talk over chat so that I can get a context about the project.
€155 EUR in 3 days
0.0 (0 reviews)
0.0
0.0
User Avatar
A proposal has not yet been provided
€55 EUR in 4 days
0.0 (0 reviews)
0.0
0.0

About the client

Flag of GERMANY
Munich, Germany
5.0
3
Payment method verified
Member since May 11, 2018

Client Verification

Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.