Re: [R] ASExtras library

2018-07-04 Thread radmuzom .
The package appears to be referenced in the package "agridat" - ftp://cran.r-project.org/pub/R/web/packages/agridat/agridat.pdf (Pg 55). However, even I tried searching for it and there seems to be no reference other than this source. Regards, radmuzom From: R-help on behalf of David

Re: [R] Generate N random numbers with a given probability and condition

2018-07-04 Thread Rolf Turner
On 05/07/18 10:21, Nelly Reduan wrote: Dear all, I would like to generate N random numbers with a given probability and condition but I'm not sure how to do this. For example, I have N = 20 and the vector from which to choose is seq(0, 10, 1). I have tested: x <- sample(seq(0, 10, 1), 20,

Re: [R] Generate N random numbers with a given probability and condition

2018-07-04 Thread Jeff Newmiller
This looks like homework (which is off topic here per the Posting Guide). Also, please send your emails in plain text format to avoid us seeing your message differently than you do. On July 4, 2018 3:21:34 PM PDT, Nelly Reduan wrote: >Dear all, > >I would like to generate N random numbers with

[R] Generate N random numbers with a given probability and condition

2018-07-04 Thread Nelly Reduan
Dear all, I would like to generate N random numbers with a given probability and condition but I'm not sure how to do this. For example, I have N = 20 and the vector from which to choose is seq(0, 10, 1). I have tested: x <- sample(seq(0, 10, 1), 20, replace=TRUE, prob=rep(0.28,

Re: [R-es] Operaciones con Arrays...creo.

2018-07-04 Thread Javier Marcuzzi
Estimado Juan Abasolo Si en su mente puede organizarlo en matrices, utilice su pensamiento, eso no es malo, pero si piensa en matrices utilice for, if, algunos índices para acceder a lugares específicos, pase lo que está en lapply a un ciclo for, todo en matrices, si salta de una forma de

Re: [R] gamlss() vs glm() standard errors via summary() vs vcov()

2018-07-04 Thread 1/k^c
Thank you, Peter! Sincerely, KeithC. On Wed, Jul 4, 2018 at 4:11 AM, Peter Dalgaard wrote: >> # Extract SEs via vcov() >> SEvcov1<-exp(coef(fit1)) *sqrt(diag(vcov(fit1))) >> SEvcov2<-exp(coef(fit2))*sqrt(diag(vcov(fit2))) > > What makes you think that you need to multiply with exp(coef())

Re: [R-es] Operaciones con Arrays...creo.

2018-07-04 Thread Juan Abasolo
Muchas gracias, Javier, por tu respuesta. Me sobrevalorás. Mi última clase de matemática como tal fue en 4º de secundaria, y era la matemática que nos daban a los de letras. Ni te cuento hace cuántos años. No puedo seguir la mayoría de lo que comentás sin hacer un trabajo forense. Así que agarré

Re: [R] R is creating a new level which is emty after importing a SAS file

2018-07-04 Thread peter dalgaard
It is not obvious that this is an error. If your nominal variable in SAS has a level which is not present in data, then R might just be making a faithful translation. There is a distinction between (a) having a gender variable with two levels of which 0 females and (b) pretending that male is

[R] R is creating a new level which is emty after importing a SAS file

2018-07-04 Thread Adam Z. Jabir
Hi, I have imported some sasdata into R using the sas7bdat package. I have some nominal variables with some missing values. R is creating a new level which is emty ��.When I ask for tabulate this new level is presented with 0 as a frequency. I want to get rid of this level and have my file

Re: [R] prod(NaN, NA) vs. prod(NA, NaN)

2018-07-04 Thread Ted Harding
I've been following this thread, and wondering where it might lead. My (possibly naive) view of these matters is basically logical, relying on (possibly over-simplified) interpretaions of "NA" and "NaN". These are that: "NaN" means "Not a Number", though it can result from a numerical

Re: [R] ASExtras library

2018-07-04 Thread David Winsemius
> On Jul 3, 2018, at 6:34 PM, Mehrshad Barary wrote: > > Hi Everyone, > > Does anybody know how I can get ASExtras library? It would be helpful if you would provide information about your reasons for assuming this package's existence. Cannot find it in CRAN (including a search for

Re: [R-es] Operaciones con Arrays...creo.

2018-07-04 Thread Javier Marcuzzi
Estimado Juan Abasolo Posiblemente lo que usted desea está en https://cran.r-project.org/web/packages/Matrix/index.html, pero yo también en su momento me puse a escribir muchas cosas que ya existían y lo realizaba para aprender (posiblemente todo el que desee aprender correctamente debe intentar

[R-es] Operaciones con Arrays...creo.

2018-07-04 Thread Juan Abasolo
Buenas, Sigo aprobechando par aaprender en las vacaciones de alumnos y nuevamente recurro a Uds. Sé que la perspectiva puede ser erronea, o sea que les pido que entiendan lo que quiero decir, más que lo que digo. Tengo una lista de matrices todas de idénticas dimensiones, y necesito hacer

Re: [R] prod(NaN, NA) vs. prod(NA, NaN)

2018-07-04 Thread Barry Rowlingson
I'm having deja-vu of a similar discussion on R-devel: https://stat.ethz.ch/pipermail/r-devel/2018-July/076377.html This was the funniest inconsistency I could find: > sum(c(NaN,NA)) [1] NaN > sum(NaN,NA) [1] NA THEY'RE IN THE SAME ORDER!!! The doc in ?NaN has this clause: In R,

Re: [R] gamlss() vs glm() standard errors via summary() vs vcov()

2018-07-04 Thread Peter Dalgaard
> # Extract SEs via vcov() > SEvcov1<-exp(coef(fit1)) *sqrt(diag(vcov(fit1))) > SEvcov2<-exp(coef(fit2))*sqrt(diag(vcov(fit2))) What makes you think that you need to multiply with exp(coef()) here??? -pd > On 4 Jul 2018, at 11:08 , 1/k^c wrote: > > Hi R-helpers, > > I was working with

[R] gamlss() vs glm() standard errors via summary() vs vcov()

2018-07-04 Thread 1/k^c
Hi R-helpers, I was working with some count data using gamlss() and glm(), and noticed that the standard errors from the two functions correspond when extracting from either the model summary for both functions, or using vcov for both functions, but the standard errors between those methods do

Re: [R] Combine by columns a vector with another vector that is constant across rows

2018-07-04 Thread Eric Berger
For what it's worth, for larger vectors, and following on from your observation that the do.call() approach is faster, the following provides some modest additional speedup: cbind(x,t(do.call(cbind, lapply(x, function(y) vec Rgds, Eric On Tue, Jul 3, 2018 at 8:12 PM, Viechtbauer, Wolfgang