Displaying 20 results from an estimated 28 matches for "sp500".
Did you mean:
ip500
2008 Sep 22
1
Help for SUR model
I am an R beginner and trying to run a SUR model in R framework.
subset(esasp500, Obs <=449 & Obs>=197, select = -Date) ->ev13sub
c(Obs>=397) & c(Obs<=399) ->d13
c(Obs>=400) & c(Obs<=449) ->f13
SP500*f13 ->SP500f13
BBC~SP500+d13+SP500f13 ->sur132
BOW~SP500+d13+SP500f13 ->sur133
CSK~SP500+d13+SP500f13 ->sur134
DTC~S...
2007 Nov 09
1
Problem reading data in Rmetrics
Hi folks - After upgrading to the latest version of Rmetrics, I can't
read in data like I used to. Is anyone seeing the following? It seems
to truncate the dates after I use "as.timeSeries".
-John
SP500<-read.table("SP500.csv",header=TRUE,sep=",")
> head(SP500)
Date Open High Low Close Volume
1 08/04/06 1280.26 1292.92 1273.82 1279.40 2530970112
2 08/03/06 1278.22 1283.96 1271.25 1280.27 2728440064
3 08/02/06 1270.73 1283.42 1270.73 1277.41 2610...
2008 Jan 24
1
Error using Rmetrics to read data
Hi folks. This set of code used to work, but after upgrading to the
latest version of Rmetrics it no longer does. Any ideas?
SP500<-read.table("SP500.csv",header=TRUE,sep=",")
> head(SP500)
Date Open High Low Close Volume Close2
1 8/4/2006 1280.26 1292.92 1273.82 1279.40 2530970112 1279.40
2 8/3/2006 1278.22 1283.96 1271.25 1280.27 2728440064 1280.27
3 8/2/2006 1270.73...
2006 Jun 23
3
Problems with weekday extraction from zoo objects
Hi Folks!
I'm struggling with dates - but enough about my personal life.....
I have two daily time series files. In one (x) the date format is Y/m/d
and the other (y) is d/m/y. I used read.zoo on both and they read into
R with no problem.
Then I use: weekdays(as.Date(x$DATE)) and get what I expect - all the
days of the week in my data set.
When I use:
2017 Aug 07
1
tidyquant error downloading symbols for Index
Hi R Helpers,
I recently tried to take advantage of the ability to download all the
tickers in the S&P 500 using the functionality of tidyquant, but it threw
an error.
For summary, the set of commands that I ran was
library(tidyquant)
tq_index_options()
tq_index("SP500")
sessionInfo()
R feedback including error message and sessionInfo are provided below.
Guidance would be appreciated.
--John J. Sparks, Ph.D.
> library(tidyquant)
Loading required package: lubridate
Attaching package: ?lubridate?
The following object is masked from ?package:base?:...
2011 Feb 19
4
Accessing DF index
I have a dataframe called x2. It seems to have a date column but I can't
access it or give it a name or convert it to a date. How do I refer to that
first column and make it a date ? When I try x2[1,] I get the second column.
head(x2)
FAIRX SP500 delta
2000-08-31 0.010101096 0.007426964 0.002674132
2000-09-29 0.096679730 -0.054966292 0.151646023
2000-10-31 -0.008245580 -0.004961785 -0.003283795
2000-11-30 0.037024545 -0.083456134 0.120480679
2000-12-29 0.080042708 0.004045193 0.075997514
2001-01-31 -0.009042396 0.034050246...
2006 Nov 22
2
problems with garchFit
...t results
different from normal, which I don't understand
garch_snorm <- garchFit(series = logr, cond.dist = 'dsnorm', include.mean =
F, include.skew = T)
Have I done something wrong? I am attaching the code, thank you.
Tian
#GARCH analysis of monthly return
rm(list=ls(all=TRUE))
sp500 <- read.csv('s&p_m90.csv', header=TRUE)
sp500 <- sp500[,2] #only adjusted close
n <- length(sp500)
logr <- log(sp500[1:n-1] / sp500[2:n])
acf(logr)
ar5 <- arima(logr, order = c(5, 0, 0), include.mean = T)
logr<- ar5$res
acf(logr)
#fit GARCH distribution
hist(logr, fr...
2006 Nov 22
0
questions about garchFit
...udent t, skew normal, skew t. But
all innovations except normal got exaxtly same coefficients, even if I
changed their parameters of skew and shape.
Is this correct for the data or something wrong? I am attaching the code,
thank you.
Muster
#GARCH analysis of monthly return
rm(list=ls(all=TRUE))
sp500 <- read.csv('s&p_m.csv', header=TRUE)
sp500 <- sp500[,2] #only adjusted close
n <- length(sp500)
logr <- log(sp500[1:n-1] / sp500[2:n])
acf(logr)
ar5 <- arima(logr, order = c(5, 0, 0), include.mean = T)
logr<- ar5$res #remove mean
acf(logr)
#fit GARCH distribution
hi...
2008 Jun 19
1
How can I shade the background area of a zoo time series object between specific dates?
Dear list members,
How can I shade the background area of a zoo time series object between
specific dates?
eg.
library(tseries)
library(zoo)
SP500<-get.hist.quote("^GSPC", start = "1990-01-01", quote =
"Close")
plot(SP500)
How can I produce the same plot but with a (say) red background between
2007-04-12
and
2008-05-14
?
Many thanks in advance...
Costas
P Think before you print....
2012 Jan 28
1
Using the digest and t distribution.
...I can find it and if there is an easy way to
access particular mails sent to you.
My second question is related to the fitting the t distribution with
the fitdistr function. I am actually trying to fit it to the standard
data set in the Ecdat package. Here is my code:
>library(ecdat)
>data(SP500)
#Fitting a normal distribution runs just fine.
> fitdistr(SP500[[1]],"normal")
mean sd
0.0004180994 0.0108610082
(0.0002058797) (0.0001455789)
#But when I try the t:
> fitdistr(SP500[[1]],"t")
m s df
0.0005236326...
2012 Aug 05
1
R: Help xts object Subset Date by Day of the Week
I have a xts object made of daily closing prices I have acquired using
quantmod.
Here is my code:
library(xts)
library(quantmod)
library(lubridate)
# Gets SPY data
getSymbols("SPY")
# Subset Prices to just closing price
SP500 <- Cl(SPY)
# Show day of the week for each date using 2-6 for monday-friday
SP500wd <- wday(SP500)
# Add Price and days of week together
SP500wd <- cbind(SP500, SP500wd)
# subset Monday into one xts object
SPmon <- subset(SP500wd, SP500wd$..2=="2")
I then used the...
2009 Nov 20
2
Problem at adding lines on a graphics with lines() function
Hello, I am trying to plot a graphic with many lines with the following
command:
plot(datas[1:n,1],datas[1:n,2],type="l",main="SP500 Prices and Moving
Averages",xlab="Date",ylab="Prices",col="black")
lines(datas[1:n,1],datas[1:n,3],type="l",col="green",lty="solid")
But I just see the first curve. I have tried it on the console separately
and it?s still not working...
2007 Jul 12
2
how to get the p-values from an lm function ?
Hi, dear R-users,
I am computing a liner regression by rating category using the 'by' function
as stated below:
tmp <- by(projet, rating, function(x) lm(defaults ~ CGDP+CSAVE+SP500, data =
x))
I would like to get not only the coefficients but also their p-values. I
can't find the command in the help pages to get them.
Does anyone have a suggestion ?
Thank you,
Benoit.
[[alternative HTML version deleted]]
2012 Dec 06
1
Fuction Error
...9;XLK','XLY','XLF','XLB','GLD','SLV','E
FA','EEM','FXA','FXE','FXY','HYG','LQD', '^GSPC')
getSymbols(symbols,from='2007-01-01')
getSymbols('SPY',from='2007-01-01')
SP500 <- Cl(SPY)
colnames(SP500)[1] <- 'SPY'
#Function to build a dataframe form a list of symbols
symbolFrame <- function(symbolList) {
Data <- data.frame(NULL)
for (S in symbolList) {
Data <- cbind(Data,Cl(get(S)))
}
colnames(Data) <- symbolList
return(Data)...
2008 Sep 11
1
how to calcaulate matrices for two subsets
I am an R beginner and trying to run a market model using event study in
R framework.
First, I run a market model, that is lm(stock security~SP500 index,
subset=Obs[197, 396]) ->result1
Then I get predict results for a new dataset using predict (result1,
newdata=Obs[397,399]) ->pred1
Pred1 should have three numbers.
Now I need to calculate abnormal return by the formula stock security
[397,399] -pred1
But it does not work after...
2007 Sep 01
1
Problem in downloading Yahoo Finance data from R
Hi R users,
I have a problem in downloading Yahoo Finance data from R. I have tried
an example given in R, to download. The error is given below:
>library(fCalendar)
> yahooImport("s=IBM&a=11&b=1&c=1999&d=0&q=31&f=2000&z=IBM&x=.csv ",
file = "D:\\ Downlaod",source = "http://ichart.yahoo.com/table.csv?",
save = FALSE,
2007 Nov 24
5
how to calculate the return?
Hi, R-users,
data is a matrix like this
AMR BS GE HR MO UK SP500
1974 -0.3505 -0.1154 -0.4246 -0.2107 -0.0758 0.2331 -0.2647
1975 0.7083 0.2472 0.3719 0.2227 0.0213 0.3569 0.3720
1976 0.7329 0.3665 0.2550 0.5815 0.1276 0.0781 0.2384
1977 -0.2034 -0.4271 -0.0490 -0.0938 0.0712 -0.2721 -0.0718
1978 0.1663 -0.0452 -0.0573 0.2751 0.1372 -0.1346 0...
2011 Aug 25
1
How download Yahoo Quote?
Hello all:
Friend told me that we can download the stock historical quote from
Yahoo site by R!
Could you tell me that is true or not, how to do that?
Thanks!
--
View this message in context: http://r.789695.n4.nabble.com/How-download-Yahoo-Quote-tp3769563p3769563.html
Sent from the R help mailing list archive at Nabble.com.
2013 Jan 08
3
Conditional Statistics
...ng a dummy var is created for 1 = Monday, 0 = else). I
understand that you can create subsets and new data sets based on the
conditional statements; but is there an easier way to do this by
typing a line into the mean() statement? That was extremely easy in
SAS where you could say:
proc means data=sp500;
var price;
where monday = 1;
Thank you for your help.
Joe
2008 Apr 11
0
aggregateSeries and seriesData in R?
hi to all!
(Q1): I'd like to ask where can i find aggregateSeries and seriesData in R packages?
(Q2): how can i perform these Splus commads in R?
e.g. annualMax.sp500 = aggregateSeries(-spto87,by="years",FUN=max)
hist(seriesData(annualMax.sp500))
(Q3): is the method of probability-weighted moments available in evir package?
Thanks!
Filame
__________________________________________________
[[alternative HTML version deleted]]