search for: rvaradha

Displaying 20 results from an estimated 23 matches for "rvaradha".

Did you mean: rvaradhan
2002 Nov 25
3
How top print intermediate values from inside a function?
Hi: In R, how do I display some intermediate results calculated in a "for" loop within a function? For example, in the attached code, how do I get it to print the intermediate variable "mh.new" for each simulation, when I call the function "MHsim.ind"? thanks for any help, Ravi. #################################################################### MHsim.ind
2004 Jul 03
4
counting the occurrences of vectors
Hi: I have two matrices, A and B, where A is n x k, and B is m x k, where n >> m >> k. Is there a computationally fast way to count the number of times each row (a k-vector) of B occurs in A? Thanks for any suggestions. Best, Ravi. [[alternative HTML version deleted]]
2003 Jul 09
2
A problem with using the "outer" function
Hi: I am using R 1.7.0 on Windows. I am having trouble getting "outer" to work on one of my functions. Here is a simple example illustrating my problem: > b1 <- c(1.2,2.3) > b2 <- c(0.5,0.6) > x <- c(3e+01, 1e+02, 3e+02, 5e+02, 1e+03, 1e+04, 1e+05, 1e+06) > y <- c(2,4,2,5,2,3,1,1) > n <- c(5,8,3,6,2,3,1,1) > outer(b1,b2,FUN=bpllkd,x,y,n)
2003 Jun 23
0
A final global mode function
...D: <3EF756A5.9040008 at pdf.com> Date: Mon, 23 Jun 2003 12:36:05 -0700 From: Spencer Graves <spencer.graves at PDF.COM> User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.0.2) Gecko/20030208 Netscape/7.02 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Ravi Varadhan <rvaradha at jhsph.edu> CC: Erin Hodgess <hodgess at uhddx01.dt.uh.edu>, r-help at stat.math.ethz.ch Subject: Re: [R] Summary for mode of a data set References: <c3910ac38114.c38114c3910a at jhsph.edu> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit St...
2002 Nov 01
1
Manipulating dataframe
Hi: Suppose, I have a dataframe (with N rows) containing the following variables: ID X82 X85 X88 >From this, I'd like to create a new dataframe (with 3*N rows), which will have the following variables: ID X82 X85 X88 Xrep where: each ID is duplicated 3 times; X82 equals its original value for the first row and equals NA for the other two; X85 equals its original value for
2002 Nov 26
2
Existence of non-vectorised functions
Dear R-Group: Recently, I ran into a problem. I was using a function called "I.1", which evaluates the first-order modified Bessel function of the first kind, in the package "CircStats". This function is not vectorized, since it uses a couple of "if" conditions. However, when I called this function with a vector argument, I got no error/warning messages in
2003 Apr 07
5
How to sort a dataframe?
Dear R-helpers, for the purpose of plotting a dataframe, i am trying to sort a dataframe by one column, for example tester <- data.frame(one=c(3,2,1), two=c(2,3,1)) #> tester # one two #1 3 2 #2 2 3 #3 1 1 # I want to sort "tester" by column "one", so that i get a dataframe # that looks like: #one two #1 1 #2 3 #3 2 I know of 'sort' but
2004 Feb 02
1
Robust nonlinear regression - sin(x)/x?
You reall have only one parameter in your model, c = a/b. You can't identify both a and b from your model, therefore, you should fit the linear model: lm(z ~ c* sin(x)/x) Ravi. ----- Original Message ----- From: cstrato <cstrato at aon.at> Date: Monday, February 2, 2004 2:28 pm Subject: [R] Robust nonlinear regression - sin(x)/x? > Dear all > > Since I did not receive any
2004 Feb 24
4
Computing the mode
Hi all, I think this question could be quite trivial, but I can?t find out the solution... How can you compute the statistic "mode" of a sample, in case it exists (as mode() returns the mode of an object)? I tried help.search("mode") but I couldn't find a clue... Any help would be much appreciated. Regards, Aurora
2002 Aug 26
5
updating n within for(i in 1:n) loop
Hi folks: I think I'm having problems with figuring this one out: test1 <- function() { n <- 2 for(i in 1:n) { cat(paste("i =", i, "\n")); flush.console() n <- 5 # version 1 #n <<- 5 # version 2 #assign("n", 5, envir = environment(test1)) # version 3 } } I need the for(.) loop to run (say) n=5 times within the
2002 Dec 18
0
Multidimensional quadrature using "integrate"
Hi: I was wondering if someone could give me some examples of how to use the "integrate" function to perform multi-dimensional quadrature? I have a posterior density (up to a constant), for which I'd like to evaluate the normalizing constant. thanks for any help, Ravi.
2003 Apr 15
1
Simulation of Stochastic processes
Hi: I was wondering whether I can find some help for computer simulation of stochastic processes (e.g. Brownian motion), for pedagogicl/instructional purposes. Any help would be appreciated. thanks, Ravi.
2003 Dec 21
0
Software/algorithms for competing risks analysis
Dear R group: I am compiling a list of available algorithms/macros/software for performing the following types of competing risks analyses: (1) cumulative (crude) incidence regression (2) Gray's K-sample log-rank test for cmulative incidence (3) multi-state models (4) dependent competing risks modeling with (a) copulas, (b) Robin's Inverse probability of censoring weighted (IPCW)
2004 Jan 20
1
Restoring an S object that was data-dumped
Hi: In R, how can I "data.restore" an object that was "data.dump"ed in Splus (I am not sure of the exact version, but probably Splus5)? When I use data.restore, I get the following error message (I am using R 1.7.0 on Windows) > data.restore("n2.suicide") Error in ReadSdump(TRUE, " ") : S mode " "Netherlands",
2004 Jun 14
1
Quadruple precision in R
Hi: Is it possible to perform computations in quadruple precision (more generally, with more digits in the floating-point arithmetic than that allowed by double precision) in R? thanks, Ravi. [[alternative HTML version deleted]]
2003 May 30
2
Normal deviate generation - Marsaglia's ziggurat method
Hi: I was wondering why Marsaglia's new ziggurat method for generating deviates from the standard normal distribution has not been implemented in the R base package. I know that it is available in SuppDists pacakage of Bob Wheeler, as "rziggurat". According my timing tests, it is about 6 to 7 times faster (on a Pentium 2.4 MHz) machine than the default Inversion method used in
2002 Dec 13
2
How to get objects from a "formula" specification?
Hi: I'd like to get the objects corresponding to the elements in a formula, from a data frame. For example, suppose I would like to make a function call, such as follows: myfunc(formula="y ~ x1 + x2 + log(x3)" , data=mydata) This function will get the vector objects y, x1, x2, and log(x3) from the data frame "mydata" to form the design matrix and then perform a
2003 Jul 15
0
Why two chisq.test p values differ when the contingency
Hi Tao: The P-values for 2x2 table are generated based on a random (discrete uniform distribution) sampling of all possible 2x2 tables, conditioning on the observed margin totals. If one of the cells is extremely small, as in your case, you get a big difference in P-values. Suppose, you changed the cell with value 1 to, say, 5 or 6, then the two P-values are nearly the same. However, I
2002 Jul 24
2
read.dta function in foreign package
Hi: When I import a Stata (version 7) data set into R, the missing values for factor and numeric variables are represented as "NaN", but the missing values for date variables are represented as "NA". Can "NaN" for numeric variables be treated as the same as "NA" ? Are there situations when these two representations are not equivalent? The following
2001 Nov 20
0
Time series count model?
You may want to take a look at a paper by Julia Kelsall and Scott Zeger in JRSS(C) - 1999, pp. 331-344. This paper describes a frequency domain approach to log-linear regression modeling of poisson-distributed count data, accounting for correlation and over-dispersion. There are also some S functions available to implement the methodology. Ravi. -----Original Message----- From: pauljohn at