Question

How do I set the problem in R? My data file is leverage.csv and the variables are: Date, SPX and VIX

Plot a summary of the predictive distribution (i.e., predictive mean and 90% interval. You will find lines command very helpful.) for VIX returns ranging from-20% to 20%.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

To input data in r when a file is "leverage.csv" then we have to use following command

Leverage <- read.csv(file = 'data/leverage.csv')
head(Leverage)

Use " as.Date( ) " to convert strings to dates

eg. mydates <- as.Date(c("2007-06-22", "2004-02-13"))

# number of days between 6/22/07 and 2/13/04
days <- mydates[1] - mydates[2]

Add a comment
Know the answer?
Add Answer to:
How do I set the problem in R? My data file is leverage.csv and the variables...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • I need help plotting the question below in R Plot a summary of the predictive distribution...

    I need help plotting the question below in R Plot a summary of the predictive distribution (i.e., predictive mean and 90% interval. You will find lines command very helpful.) for VIX returns ranging from-20% to 20%. Date SPX 1/4/10 0 1132.99 19.351136.52 19.16 1137.14 9.06 1141.69 18.131144.98 17.55 1146.98 18.25 1136.22 17.85 1145.68 17.63 1148.46 17.91 1136.03 17.58 1150.23 18.68 1138.04 22.27 1116.48 1091.76 25.41 1096.78 24.55 1092.17 1/27/1023.14 1097.5 23.73 1084.53 24.62 1073.87 22.59 1089.19 21.48 1103.32 21.6 1097.28...

  • R Programming Exercise Book Problem 57 (Difficulty: Easy) A normal distribution has a standard deviation of...

    R Programming Exercise Book Problem 57 (Difficulty: Easy) A normal distribution has a standard deviation of 35 and mean of 15. From this generate 2 to 400 samples. After generating the samples utilize the plot command to plot the mean of the generated sample (x-axis) against the number of samples. Create a second plot of the density of the 400 samples that you generated. This code can be solved in 4 to 8 lines. For this problem use the following...

  • R code all steps (copy paste it) - for all answers . R problem 1: Cernsus...

    R code all steps (copy paste it) - for all answers . R problem 1: Cernsus At School is a project that engages students in grades 4 - 12. The data from the project contains many variables. In this problem we will examine the following variables: -Languages.spoken: the number of languages a student can hold an everyday conversation Armspan.cm: the physical measurement of the length from one end of a student's arms (measured at the fingertips) to the other when...

  • NEED R CODE PLEASE ## Problem 4 *For the `homedata` (**UsingR**) data set find 90% confidence...

    NEED R CODE PLEASE ## Problem 4 *For the `homedata` (**UsingR**) data set find 90% confidence intervals for both variables `y1970` and `y2000`, assuming the sample represents some population. Perform one sample t-test for each variable, use `t.test()`, but first discuss whether the model assumptions are appropriate (include some check of the assumptions, like a Q-Q plot).*

  • 3. R programming 3. This problem uses the wblake data set in the alr4 package. This...

    3. R programming 3. This problem uses the wblake data set in the alr4 package. This data set includes samples of small mouth bass collected in West Bearskin Lake, Minnesota, in 1991 Interest is in predicting length with age. Complete this problem without using Im( in R (a) Do the regression of length on age, and report the estimates, their standard errors and the estimate of variance. Interpret Bo and (b) Obtain a 900% confidence interval for βί fron the...

  • How to graph fourier transform My question isn't on how they got the transform, my question is how the graph was calculated, I don't know what sinc means Note: 1) In the following problem set...

    How to graph fourier transform My question isn't on how they got the transform, my question is how the graph was calculated, I don't know what sinc means Note: 1) In the following problem set a notation Pa(t) is used to denote an even pulse (i.e. rectangular) shape function with the duration of a. This means that for example the function x(t) in question number one is 2P2(t-1). It is clear that using the properties of Fourier transform is greatly...

  • Someone plz plz help with this Statistics Intro to R programming question!!! Here are the examples and follow by my question!! Thank you so much!! I appreciate it !!!!My question!!!! Question T...

    Someone plz plz help with this Statistics Intro to R programming question!!! Here are the examples and follow by my question!! Thank you so much!! I appreciate it !!!!My question!!!! Question Type 1: If possible, calculate the 90% confidence intervals for the temperature it takes for crickets to chirp 15 chirps per second. Code (you must copy and paste your code like below in blue color): # Reading in the data Crickets-read.table(C:/Desktop/CricketChirpsvsTemperature.csv', header TRUE, #View Data View Crickets) #Data analysis...

  • I can't attach the data due to the file being real large i can email it...

    I can't attach the data due to the file being real large i can email it to you so i can have your help on it # Assignment 1 # R Programming Language # ---- Why do Exploratory Data Analysis (EDA)? ---- # We will be looking at ## identifying outliers ## null values ## generating plots ## examining correlations # -------------------------------------------------------------- # In this video we will cover: ## univariate plots for continuous variables (boxlots, historgrams) ## bivariate plots...

  • Exercise 1. For this exercise use the bdims data set from the openintro package. Type ?bdims to r...

    Exercise 1. For this exercise use the bdims data set from the openintro package. Type ?bdims to read about this data set in the help menu. Of interest are the variables hgt (height in centimeters), wgt (weight in kilograms), and sex (dummy variable with 1-male, 0-female). Since ggplotO requires that a categorical variable be coded as a factor type in R, run the following code: library (openintro) bdíms$sex2 <-factor (bdins$sex, levels-c (0,1), labels=c('F', 'M')) (a) Use ggplot2 to make a...

  • Exercise 2. [Data analysis, requires R] For this questions use the bac data set from the...

    Exercise 2. [Data analysis, requires R] For this questions use the bac data set from the openintro library. To access this data set first install the package using install.packages ("openintro") (this only needs to be done once). Then load the pack- age into R with the command library(openintro). You can read about this data set in the help menu by entering the command ?openintro or help(openintro). Many people believe that gender, weight, drinking habits, and many other factors are much...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT