Re: [R] Need Help To Solve An Equation In R

2017-05-27 Thread Bert Gunter
Then: 1. Always cc the list; 2. Read and follow the posting guide: no HTML, plain text only. Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) On Sat, May 27,

[R] rollapply() produces NAs

2017-05-27 Thread Sepp via R-help
Hello, I am fairly new to R and trying to calculate value at risk with exponentially decreasing weights.My function works for a single vector of returns but does not work with rollapply(), which is what I want to use. The function I am working on should assig exponentially decreasing weights to

Re: [R] Need Help To Solve An Equation In R

2017-05-27 Thread Bert Gunter
Homework? We generally don't do homework here. Cheers, Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) On Sat, May 27, 2017 at 9:16 AM, Neetu Shah

Re: [R] creat contingency tables with fixed row and column margins

2017-05-27 Thread Jeff Newmiller
Ah, but the point is that you did not say why those search results did not address your question, since if they DID answer your question then why should we have to be doing your searching for you? -- Sent from my phone. Please excuse my brevity. On May 27, 2017 1:54:18 PM PDT, li li

Re: [R] creat contingency tables with fixed row and column margins

2017-05-27 Thread li li
I meant that the post in your link above was NOT asked by me. 2017-05-27 16:53 GMT-04:00 li li : > Hi Dave, > Thanks for your reply but the post in your link above was certainly > asked by me. >Hanna > > 2017-05-27 16:04 GMT-04:00 David Winsemius

Re: [R] creat contingency tables with fixed row and column margins

2017-05-27 Thread li li
Hi Dave, Thanks for your reply but the post in your link above was certainly asked by me. Hanna 2017-05-27 16:04 GMT-04:00 David Winsemius : > > > On May 27, 2017, at 12:49 PM, li li wrote: > > > > Hi all, > > Is there an R function that can

Re: [R] Latin Hypercube Sampling when parameters are defined according to specific probability distributions

2017-05-27 Thread Rob C
>May 26, 2017; 11:41am Nelly Reduan Latin Hypercube Sampling when parameters >are >defined according to specific probability distributions >Hello, > I would like to perform a sensitivity analysis using a Latin Hypercube > Sampling (LHS). >Among the input parameters in the model, I have a

Re: [R] creat contingency tables with fixed row and column margins

2017-05-27 Thread David Winsemius
> On May 27, 2017, at 12:49 PM, li li wrote: > > Hi all, > Is there an R function that can be used to enumerate all the contingency > tables with fixed row and column margins. For example, can we list all 3 by > 3 tables with row margins 3,6,6 and column margins 5,5,5.

[R] creat contingency tables with fixed row and column margins

2017-05-27 Thread li li
Hi all, Is there an R function that can be used to enumerate all the contingency tables with fixed row and column margins. For example, can we list all 3 by 3 tables with row margins 3,6,6 and column margins 5,5,5. Thanks very much! Hanna [[alternative HTML version deleted]]

Re: [R] Need Help To Solve An Equation In R

2017-05-27 Thread David Winsemius
> On May 27, 2017, at 9:16 AM, Neetu Shah wrote: > > Dear Sir/Ma'am, > > I am trying to make a function to solve an equation that is given below: > findH <- function(p_star, k){ > fun <- function(y){ > (pnorm(y+h))^(k-1)*dnorm(y) > } > lhs <- integrate(fun, -Inf,

[R] Need Help To Solve An Equation In R

2017-05-27 Thread Neetu Shah
Dear Sir/Ma'am, I am trying to make a function to solve an equation that is given below: findH <- function(p_star, k){ fun <- function(y){ (pnorm(y+h))^(k-1)*dnorm(y) } lhs <- integrate(fun, -Inf, Inf)$value return(uniroot(lhs, lower = -10, upper = 10, tol = p_star)$root) } In lhs, I integrated a

Re: [R] Problem with Example with Lattice

2017-05-27 Thread Bert Gunter
I was surprised this worked at all, as I usually use the formula interface. Anyway, you need to explicitly specify the point types via the pch argument. The default uses trellis.par.get("dot.symbol"), which is just a single value. -- Bert Bert Gunter "The trouble with having an open mind

[R] Amelia

2017-05-27 Thread Johanna von Bahr
Hi, I have some trouble with Amelia. I run the following: all.data<-read.csv2("jldata2.csv", header = TRUE) summary(all.data) corp<-plm.data(all.data, cbind("country", "year")) data.mi <- Amelia::amelia(corp, idvars=1, ts=2, cs=3,intercs=FALSE,nom=4,5,6, 7, 8, 13, 14,19:27, 61 ,

[R] Problem with Example with Lattice

2017-05-27 Thread Lorenzo Isella
Dear All, I am making my baby steps with the lattice graphic system. I am going through the great book by Sarkar which provides plenty of examples. However, I notice that some of them appear to give a different result on my system. For instance, consider the following library(lattice)