[R] Import data from Access

2007-05-31 Thread livia
Hi, I want to import some data from Access and I am using the following codes: testdb - file.path(c/../db1) channel - odbcConnect(testdb) sqlFetch(channel,tbl,colnames = TRUE, rownames = FALSE) It comes out the error message: 1: [RODBC] ERROR: state IM002, code 0, message [Microsoft][ODBC

[R] tapply

2007-06-01 Thread livia
Hello, I want to conduct normality test to a series of data and get the p-value for each subset. I am using the following codes, but it does not work. tapply(re, list(reg, ast), pvalue(shapiro.test)) Could anyone give me some advice? Many thanks. -- View this message in context:

[R] tapply histogram

2007-06-01 Thread livia
Dear members, I would like to pass the histogram settings to each subset of the dataframe, and generate a multiple figures graph. First, can anyone tell me how to generate a multiple figures environment? I am trying mfrow=c(2,4) and nothing appears. Secondly, I want to pass the following

[R] extract data from Access

2007-06-05 Thread livia
Hi, I have imported an Access Database into R. There are three variables in the Access database, return, a and b. Among them a and b are factors. I would like to extract return from it, i.e return of a in level 1 and b in level 2. I would appreciate any advice. Many thanks. -- View this message

[R] plot histogram and print

2007-06-05 Thread livia
I have got a dataset with two factors, and I would like to print the histograms of the variable return for each combination of the two factors. I do not know how can I name the figure title to sth like main=alevel blevel according to the data. par(ask=TRUE) myhistogram - function(x) { hist (x,

[R] standard error of skewness

2007-06-05 Thread livia
Hi, I just wonder how can I calculate the standard error of skewness? Basiclly, I would like to test whether it is too skewed or not? Many thanks -- View this message in context: http://www.nabble.com/standard-error-of-skewness-tf3872201.html#a10970956 Sent from the R help mailing list

[R] Pareto Distribution

2007-06-12 Thread livia
I would like to fit a Pareto Distribution and I am using the following codes. First, I thought the fitted (fit1) should be the fitted value for the data, is it correct? As the result of the fitted turns out to be the same value. fit=vglm(ycf1 ~ 1, pareto1(location=alpha), trace=TRUE, crit=c)

[R] Fitted value

2007-06-13 Thread livia
I would like to fit a Pareto Distribution and I am using the following codes. I thought the fitted (fit1) should be the fitted value for the data, is it correct? As the result of the fitted turns out to be a single value for all. fit=vglm(ycf1 ~ 1, pareto1(location=alpha), trace=TRUE, crit=c)

[R] Fitted Value Pareto Distribution

2007-06-13 Thread livia
I would like to fit a Pareto Distribution and I am using the following codes. I thought the fitted (fit1) should be the fitted value for the data, is it correct? As the result of the fitted turns out to be a single value for all. fit=vglm(ycf1 ~ 1, pareto1(location=alpha), trace=TRUE, crit=c)

Re: [R] Fitted Value Pareto Distribution

2007-06-14 Thread livia
Thank you very much and that is exactly what I am looking for. Another question would be how can I test the goodness of fit for the Pareto distribution? J. Hosking wrote: livia wrote: I would like to fit a Pareto Distribution and I am using the following codes. I thought the fitted

[R] Goodness of fit- Pareto distribution

2007-06-14 Thread livia
Hello, I have fitted a Pareto Distribution for some data, I would appreciate if anyone can tell me how to evaluate the goodness of fit for the distribution. What I do now is rather subjective. I just compare the emprcical density distribution and the fitted density distribution. -- View this

[R] Loop for test statistic

2007-06-15 Thread livia
I would like to obtain the statistic of A2 for ycf between the value 0.0032 and 0.09, and I am using the following codes. while (0.0032 ycf 0.09) { A2 - A2_GOFlaio(ycf, dist=GEV)[1] print(A2) } Could anyone give me some advice as it does not work. Many thanks. -- View this message in

[R] Optimization

2007-06-18 Thread livia
Hi, I would like to minimize the value of x1-x2, x2 is a fixed value of 0.01, x1 is the quantile of normal distribution (0.0032,x) with probability of 0.7, and the changing value should be x. Initial value for x is 0.0207. I am using the following codes, but it does not work. fr - function(x) {

Re: [R] Optimization

2007-06-19 Thread livia
It is of great help for your advice. Thanks a lot to you all. livia wrote: Hi, I would like to minimize the value of x1-x2, x2 is a fixed value of 0.01, x1 is the quantile of normal distribution (0.0032,x) with probability of 0.7, and the changing value should be x. Initial value for x

[R] Function -return value

2007-06-19 Thread livia
Hi, I am trying to write a function with the following codes and I would like it to return the values for alpha beta para parab seperately. Then I would like to use this funstion for variable with factor a and b. But the result turns out to be a matrix with element like Numeric,2 ... I guess

[R] Histogram

2007-06-19 Thread livia
Hello, I am using the following codes to plot a histogram and density line for x. For the density line, I just want it to show the two tails, eg, for x larger than 0.05 ans smaller than -0.05 hist (x, seq(-0.1,0.1,0.01),freq = FALSE) lines (density(x,bw=SJ), x 0.05 x (-0.05), col = red) But is

[R] cbind

2007-06-29 Thread livia
Hi, I have a series of return data, a and b are factors. I would like to build a matrix which contains each vector of returns. I am thinking about something as following, but I guess there should be a sensible way of doing this. returns - split(return, list(regimef, assetf)) cbind(returns[[1]],

[R] Exponentially Weighted Moving Average

2007-07-03 Thread livia
Hi, I have got a series of data x and some parameter a, and I would like to take some Exponentially Weighted Moving Average to the data in the following fomula, and obtain the return series y y1=a^265*x[2]+a^264*x[3]+a^263*x[4]+...+a^0*x[267] y2=a^264*x[4]+a^263*x[5]+a^263*x[6]+...+a^0*x[268]

[R] EWMA procedure to forecast variance

2007-07-03 Thread livia
Hello, I would like to use the Exponential Weighted Moving Average procedure to get the variance. Is there any R function for doing this? Many thanks. -- View this message in context: http://www.nabble.com/EWMA-procedure-to-forecast-variance-tf4018317.html#a11412324 Sent from the R help

[R] EWMA in fMultivar

2007-07-03 Thread livia
Hello, I would like to use the function EWMA() in the fMultivar Package and I have a series of data x, which is the returns series. Basically, I would like to get the variance estimation using EWMA. I am trying something like EWMA(x, lambda) and I have a couple of questions: Should x be the

[R] sequences

2007-07-03 Thread livia
Hi, I would like to generate a series in the following form (0.8^1, 0.8^2, ..., 0.8^600) Could anyone tell me how can I achieve that? I am really new to R. -- View this message in context: http://www.nabble.com/sequences-tf4019146.html#a11414836 Sent from the R help mailing list archive at

Re: [R] sequences

2007-07-04 Thread livia
Hi all, thank you very much. livia wrote: Hi, I would like to generate a series in the following form (0.8^1, 0.8^2, ..., 0.8^600) Could anyone tell me how can I achieve that? I am really new to R. -- View this message in context: http://www.nabble.com/sequences-tf4019146.html

[R] Loop and cbind

2007-07-04 Thread livia
Hi, I would like to apply the following function for i between 1 and 12, and then construct a list of the return series. for (i in 1:12){ ewma[i] - emaTA(calm[[i]]^2,0.03) standard[i]- calm[[i]]/sqrt(ewma[i]) standard - cbind(standard[i]) } But it does not work. Could anyone give me some advice

[R] Loop and function

2007-07-05 Thread livia
Hi All, I am trying to make a loop for a function and I am using the following codes. p and var are some matrix obtained before. I would like to apply the function gpdlow for i in 1:12 and get the returnlow for i in 1:12. But when I ask for returnlow there are warnings and it turns out some

Re: [R] Loop and function

2007-07-05 Thread livia
? --- livia [EMAIL PROTECTED] wrote: Hi All, I am trying to make a loop for a function and I am using the following codes. p and var are some matrix obtained before. I would like to apply the function gpdlow for i in 1:12 and get the returnlow for i in 1:12. But when I ask

Re: [R] Loop and function

2007-07-05 Thread livia
[,i][var[,i](p[,i][[2]])) so that we can see what the data looks like. You still haven't provided a self-contained example, so we can only guess at what is happening. On 7/5/07, livia [EMAIL PROTECTED] wrote: Thanks a lot. I have corrected this. But it still does not work. Any thought

Re: [R] Loop and function

2007-07-05 Thread livia
the data looks like. You still haven't provided a self-contained example, so we can only guess at what is happening. On 7/5/07, livia [EMAIL PROTECTED] wrote: Thanks a lot. I have corrected this. But it still does not work. Any thought? Stephen Tucker wrote: You do not have

[R] Fraction ECDF

2007-07-10 Thread livia
Hi all, I would like to plot part of the emperical CDF. Suppose the variable is x, I just need the part when x1,therefore, I am using the following codes. tail - x1 plot(ecdf(x[tail]), do.points=FALSE, verticals=TRUE) The x value starts from 1, but the yaxs still begins from 0, not the

Re: [R] Fraction ECDF

2007-07-10 Thread livia
Thank you very much. Duncan Murdoch-2 wrote: On 7/10/2007 10:36 AM, livia wrote: Hi all, I would like to plot part of the emperical CDF. Suppose the variable is x, I just need the part when x1,therefore, I am using the following codes. tail - x1 plot(ecdf(x[tail]), do.points=FALSE

[R] ECDF, distribution of Pareto, distribution of Normal

2007-07-10 Thread livia
Hello all, I would like to plot the emperical CDF, normal CDF and pareto CDF in the same graph and I amusing the following codes. z is a vector and I just need the part when z between 1.6 and 3. plot(ecdf(z), do.points=FALSE, verticals=TRUE, xlim=c(1.6,3),ylim=c(1-sum(z1.6)/length(z), 1)) x -

Re: [R] ECDF, distribution of Pareto, distribution of Normal

2007-07-11 Thread livia
hint? Stefan Grosse-2 wrote: Original Message Subject: [R] ECDF, distribution of Pareto, distribution of Normal From: livia [EMAIL PROTECTED] To: r-help@stat.math.ethz.ch Date: Tue Jul 10 2007 18:35:04 GMT+0200 Hello all, I would like to plot the emperical CDF, normal

[R] CDF for pareto distribution

2007-07-11 Thread livia
Hi, I would like to use the following codes to plot the CDF for pareto distribution. Before doing this, I have plot the emperical one. x - seq(1.6, 3, 0.1) lines(x,pgpd(x, 1.544,0.4477557,), col=red) Could anyone give me some advice whether the above codes are correct? Many thanks. -- View

Re: [R] CDF for pareto distribution

2007-07-11 Thread livia
Hi, thank you very much for your reply. The function pgpd() is from the package POT, and the 1.544 is the location parameter, 0.4477557 is the scale parameter and -0.50113 is the shape parameter, which can be both negtive or positive. Vincent Goulet wrote: Le 07-07-11 à 07:56, livia a écrit

[R] matrix of scatterplots

2007-07-12 Thread livia
Hi, I would like to use the function pairs() to plot a matrix of scatterplots. For each scatterplot, the data are plotted in circles, can I add some argument to change the circles into dots? Could anyone give me some advice?Many thanks -- View this message in context:

Re: [R] matrix of scatterplots

2007-07-12 Thread livia
Thank you very much for your help. Adaikalavan Ramasamy wrote: m - matrix( rnorm(300), nc=3 ) pairs(m, pch=20) or pairs(m, pch=.) See help(par) for more details. livia wrote: Hi, I would like to use the function pairs() to plot a matrix of scatterplots. For each scatterplot

[R] correlation matrix difference

2007-07-13 Thread livia
Hi, I have got four correlation matrix. They are the same set of variables under different conditions. Is there a way to test whether the correlation matrix are significently different among each other? Could anyone give me some advice? -- View this message in context:

[R] Plot time series data

2007-07-16 Thread livia
Hi all, I have got a list named data, and data[[1]] is the Date(dd-mm-), data[[2]] is the time series data. I would like to plot the data in the time series format with xlab be the date.I am using the function in the library(QRMlib). tfin - timeSeries(data[[2]]) plot.timeSeriesIts(tfin) How

[R] Time Series Data

2007-07-16 Thread livia
Hi all, I have got some time series data. Data[[1]] is the data in the format 1975-12-05 1975-12-12 1975-12-19..., data[[2]] is the time series data. I would like to generate the time series format as 1975-12-05 1.5 1975-12-12 2.3etc. I am thinking about cbind(data[[1]],data[[2]]), but it

[R] fSeries GARCH(1,1)

2007-07-19 Thread livia
Hello all, I am trying to use the garchFit function in the fSeries Package to fit a Garch(1,1) Model with t distribution. I am using the following codes. fit - garchFit(~garch(1,1),data,cond.dist=dstd) fitted(fit) I was expecting the fitted(fit) would return the fitted volatility, but the

[R] Fit t distribution

2007-07-24 Thread livia
Hi all, I am trying to fit t distribution using the function tFit in the library(fBasics). I am using the code tFit(datac[[2]]) and it returns the following list. Title: Student-t Parameter Estimation Call: tFit(x = datac[[2]]) Model: Student-t Distribution Estimated Parameter(s):

Re: [R] Fit t distribution

2007-07-24 Thread livia
It works. Many thanks Henrique Dallazuanna wrote: Hi, tFit(datac[[2]])@fit$estimate -- Henrique Dallazuanna Curitiba-Paraná-Brasil 25° 25' 40 S 49° 16' 22 O On 24/07/07, livia [EMAIL PROTECTED] wrote: Hi all, I am trying to fit t distribution using the function tFit

[R] Fit t Copula

2007-07-26 Thread livia
Hi, I am trying to fit t copula to some data, and I am using the following function in the library(QRMlib). Udatac - apply(datac, 2, edf,adjust=1) tcopulac - fit.tcopula.rank(Udatac) But the error message come out Error in fit.tcopula.rank(Udatac) : Non p.s.d. covariance matrix Could anyone

[R] Histogram Title SizeFont

2007-08-29 Thread livia
Hello, I would like to plot a histogram with title Return, and I would like the font for the title to be Bold and the size to be 8( as in Excel). I tried the following code, but it does not make any change. Could anyone give me some advice? hist (preturn, seq(-0.05,0.05,0.005),freq = FALSE,

[R] creat list

2007-09-06 Thread livia
Hi, I have a list named lista, which has 50 vectors and each vector has the length about 1200. I would like to creat a matrix out of lista. What I try now is cbind(lista[[1]],lista[[2]],...,lista[[50]]). I guess there would be an easy way of doing this. Could anyone give me some advice? --

Re: [R] creat list

2007-09-06 Thread livia
Many thanks. Uwe Ligges wrote: livia wrote: Hi, I have a list named lista, which has 50 vectors and each vector has the length about 1200. I would like to creat a matrix out of lista. What I try now is cbind(lista[[1]],lista[[2]],...,lista[[50]]). I guess there would be an easy