Re: [R] a question on impulse responses

2007-10-13 Thread sj
I am pretty sure, it is a unit shock. I think that it says in th documentation. On 10/13/07, Martin Ivanov <[EMAIL PROTECTED]> wrote: > > > Dear R users, > > I am using the vars package to calculate the impulse response functions > and the forecast error variance decomposition of a VAR model. Unfo

[R] cross tabulation

2007-10-13 Thread Louis Martin
Howdy, I am looking for an efficient and fast way for doing this: for (v in 1:dw) {ok <-list1[v,] for (z in 1:5) {kk = ok[z] ; for (o in 1:t) {if (kk== list[o]) n<- n+1}} show(n) } list1 : a data.frame with nrow = dw ; ncol = z; list2 : a data.fram

Re: [R] R API - optim

2007-10-13 Thread Dirk Eddelbuettel
On 14 October 2007 at 05:58, Wang Chengbin wrote: | I am trying to use the R API to call optim functions (nmmin, vmmin, lbfgsb, | etc.) through a C program but I couldn't find the shared library to link | under the R-2.6.0 build which is compiled under Linux (REL5). You can't just call an _R_ fun

[R] lme() random form

2007-10-13 Thread Irene Mantzouni
Dear all, I am trying to fit a lme of the form: m=lme(y~F*x-1, random=...,data=...) F is a 2-level factor since I need the fixed part to differ for 2 groups. The random part depends on subgroups G. I would like to have a random effect only on the slope and I cannot figure out how to formulat

Re: [R] Question re matplot

2007-10-13 Thread Marc Schwartz
On Sat, 2007-10-13 at 22:16 -0500, David Kaplan wrote: > Yea, sorry, that was a typo when I copied into my emal. > > Here it is again > matplot(battingagg$X, battingagg[, c("HR","RBI","X2B", "BB", > "R", "SB")], type="b",lty=4,lwd=2, col=1:4,xlab = "Year", > ylab = "(1)HRs, (2)RBIs, (3)DOUBLES,(

Re: [R] Question re matplot

2007-10-13 Thread David Kaplan
Yea, sorry, that was a typo when I copied into my emal. Here it is again matplot(battingagg$X, battingagg[, c("HR","RBI","X2B", "BB", "R", "SB")], type="b",lty=4,lwd=2, col=1:4,xlab = "Year", ylab = "(1)HRs, (2)RBIs, (3)DOUBLES,(4)BB,(5)Runs,(6) BB", pty="m",sub = "Figure 2. Plot of Selected O

Re: [R] Question re matplot

2007-10-13 Thread Marc Schwartz
On Sat, 2007-10-13 at 22:00 -0500, David Kaplan wrote: > Hi, > > I have the following script for matplot > > matplot(battingagg$X, battingagg[, c("HR","RBI","X2B", "BB", > "R", "SB")], type="b",lty=4,lwd=2, col=1:4,xlab = "Year", > ylab "(1)HRs, (2)RBIs, (3)DOUBLES,(4)BB,(5)Runs,(6) BB", > pty

[R] Question re matplot

2007-10-13 Thread David Kaplan
Hi, I have the following script for matplot matplot(battingagg$X, battingagg[, c("HR","RBI","X2B", "BB", "R", "SB")], type="b",lty=4,lwd=2, col=1:4,xlab = "Year", ylab "(1)HRs, (2)RBIs, (3)DOUBLES,(4)BB,(5)Runs,(6) BB", pty="m",sub = "Figure 2. Plot of Selected Offensive Baseball Statistics:

Re: [R] the use of the .C function

2007-10-13 Thread Charles C. Berry
On Sat, 13 Oct 2007, Bernardo Lagos Alvarez wrote: > Hi all, > > here others doubts, when load and running the function > > void gdot(double *x,double *y,int *n,double *output){ > int i; > *output=0; > for (i=0;i<*n;i++){ > *output+=x[i]*y[i]; > } > } > > > as following > > /examplesC$ R CMD SHLIB

[R] R API - optim

2007-10-13 Thread Wang Chengbin
I am trying to use the R API to call optim functions (nmmin, vmmin, lbfgsb, etc.) through a C program but I couldn't find the shared library to link under the R-2.6.0 build which is compiled under Linux (REL5). main.cpp:35: undefined reference to `Rf_initEmbeddedR(int, char**)' main.cpp:41: undefi

Re: [R] Error Message from R

2007-10-13 Thread Ben Bolker
Rutendo Dadiso Kaviya wrote: > > Hi, > > I am trying to calculate the descretionary accruals using the > bootstrapping technique with the R program, but I keep getting an error > message. > > Previously, after typing in the command on the front sreen, R would > return the output wi

[R] Make playwith a default graphic device

2007-10-13 Thread Ronaldo Reis Junior
Hi, I looking for a graphic device on Linux with more functionalities than the X11 (). I find the plotAndPlayGTK package and the playwith function. It is a good device. It is possible to make it default in my system. Now I need: > library(plotAndPlayGTK ) Loading required package: RGtk2 Loading

[R] reading data and Variance Ratio Tests for Weak-form Market Efficiency

2007-10-13 Thread Jasim Al-AJmi
Dear Rhelp I am first time user of R and I have the following questions: 1. How I can load my data (it is a matrix 10x1618) with the titles of the variables in the first row? 2. How I can run vrtest to calculate Variance Ratio Tests for Weak-form Market Efficiency? Thanks in advance. Jasi

Re: [R] the use of the .C function

2007-10-13 Thread Katharine Mullen
Let me also comment that you are trying to interface to a function ported to C++ from the Cephes library, which is in C. You have not explained why you are trying to interface to the function (is this an exercise, or do you suspect a problem with digamma()?), but if you just want access to it as i

Re: [R] the use of the .C function

2007-10-13 Thread Duncan Temple Lang
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 The code is C++ and so is compiled using the C++ compiler, not the C compiler. This is because the name of the file is .cpp (and you include iostream.h, but don't seem to make any use of it.) As a result, the names of the routines are "mangled" and s

Re: [R] Controlling values in read.table

2007-10-13 Thread jim holtman
just store in the list the values you want: list1 <- list() for (i in list.files(pattern=".*c02.*AFDH0.*")){ x <- read.table(i,skip=20,fill=TRUE) list1[[i]] <- subset(x, value > 1.0) } On 10/13/07, Svempa <[EMAIL PROTECTED]> wrote: > > I have this code: > > list1 <- list() > for (i in

Re: [R] How to identify the two largest peaks in a trimodal distribution

2007-10-13 Thread jim holtman
You can use 'rle' to find where the direction changes and use that to determine the peaks: > # create test data > x <- seq(-2,7, length=2000) > y <- dnorm(x) + dnorm(x,3) > plot(y,type='l') > # find where direction changes from plus to minus > z <- rle(diff(y) > 0)# find where breaks are > z R

[R] the use of the .C function

2007-10-13 Thread Bernardo Lagos Alvarez
Hi all, here others doubts, when load and running the function void gdot(double *x,double *y,int *n,double *output){ int i; *output=0; for (i=0;i<*n;i++){ *output+=x[i]*y[i]; } } as following /examplesC$ R CMD SHLIB xby.c gcc -std=gnu99 -I/usr/share/R/include -I/usr/share/R/include -fpic

Re: [R] geom_errorbar with ggplot2

2007-10-13 Thread hadley wickham
Hi Pedro, That's a bug in the current version of ggplot. I'll try to get a new version on CRAN soon, but if you let me know what platform you're on, I can send you a fixed version right away. Hadley On 10/13/07, Pedro de Barros <[EMAIL PROTECTED]> wrote: > Dear All, > > I am trying to build an

[R] the use of the .C function

2007-10-13 Thread Bernardo Lagos Alvarez
Dear All, could someone please shed some light on the use of the .C or .Fortran function: I am trying load and running on R the following function // psi.cpp -- psi function for real arguments. // Algorithms and coefficient values from "Computation of Special // Functions", Zhang a

[R] geom_errorbar with ggplot2

2007-10-13 Thread Pedro de Barros
Dear All, I am trying to build an error bar plot with ggplot2. However, even if the code seems to work, the plot is rather odd, with what seems to be a continuous line linking the different bars. I attach below the code I used, as well as the data. ==

[R] Controlling values in read.table

2007-10-13 Thread Svempa
I have this code: list1 <- list() for (i in list.files(pattern=".*c02.*AFDH0.*")){ x <- read.table(i,skip=20,fill=TRUE) list1[[i]] <- x } Somehow I would like the read.table function to read only values in each file that are over a certain limit, say >1. Is this the easiest way or is it bet

[R] impulse responses: standard deviation or unit shocks?

2007-10-13 Thread Martin Ivanov
Dear R users, I am using the vars package to calculate the impulse response functions and the forecast error variance decomposition of a VAR model. Unfortunately I do not know whether these functions assume unit or one standard deviation shocks. I tried to look into the code of these functions,

[R] shocks

2007-10-13 Thread Martin Ivanov
Dear R users, I am using the vars package to calculate the impulse response functions and the forecast error variance decomposition of a VAR model. Unfortunately I do not know whether these functions assume unit or one standard deviation shocks. I tried to look into the code of these functions,

[R] vars shocks assumption

2007-10-13 Thread Martin Ivanov
Dear R users, I am using the vars package to calculate the impulse response functions and the forecast error variance decomposition of a VAR model. Unfortunately I do not know whether these functions assume unit or one standard deviation shocks. I tried to look into the code of these functions

[R] a question on impulse responses

2007-10-13 Thread Martin Ivanov
Dear R users, I am using the vars package to calculate the impulse response functions and the forecast error variance decomposition of a VAR model. Unfortunately I do not know whether these functions assume unit or one standard deviation shocks. I tried to look into the code of these functions

Re: [R] collapsing a data frame

2007-10-13 Thread Gabor Grothendieck
The library statement should have been library(doBy). Also note that collapse assumes that all by variables are factors although it would only add one statement to collapse to coerce them to factors if we wanted that. On 10/13/07, Gabor Grothendieck <[EMAIL PROTECTED]> wrote: > As far as I know y

Re: [R] collapsing a data frame

2007-10-13 Thread Gabor Grothendieck
As far as I know you will have to do some work yourself but if we leverage some of it off the summaryBy function in doBy its basically just a lapply over the columns. The first arg to collapse is a formula whose rhs contains the by variables and whose lhs is ignored. data is our data frame, fac.f

Re: [R] A read.table mystery (data for Filemaker Mac)

2007-10-13 Thread Mark Wardle
On 12/10/2007, Emmanuel Charpentier <[EMAIL PROTECTED]> wrote: > Mark Wardle a écrit : > > 1. Which version of Filemaker? NB: Framemaker is a different program > > (desktop publishing), so do be a little precise! > > Dunno. The file is named "export.fm7" ; one might be tempted to infer > Filemaker

Re: [R] embedding plots

2007-10-13 Thread Jim Lemon
Josue G. Martinez wrote: > Hello! > > I am trying to embed a plot of a curve(say x^2) on a matrix that > I am viewing using the image(matrix) command. > > I was wondering if someone could give me some idea > of how to do this. > Hi Jose, This may be way off what you want, but: testmat<-matrix(r

Re: [R] How to identify the two largest peaks in a trimodal distribution

2007-10-13 Thread Paul Smith
On 10/13/07, Rob Knell <[EMAIL PROTECTED]> wrote: > I'm trying to do a simulation that involves identifying the minimum > point between two peaks of a (usually) bimodal distribution. I can do > this easily if there are only two peaks: > > CnBdens<-density(Ys/Xs) #probability density function for ra

[R] Error Message from R

2007-10-13 Thread Rutendo Dadiso Kaviya
Hi, I am trying to calculate the descretionary accruals using the bootstrapping technique with the R program, but I keep getting an error message. Previously, after typing in the command on the front sreen, R would return the output without any problems. I am now using a different da