Re: [R] Would Like Some Advise

2020-08-28 Thread Duy Tran
I've worked with a 16 Gb laptop of RAM and it's been plenty for me. If you need to work with larger data, I think you should look into packages like sparklyr, which is basically dplyr running on a Spark cluster. Hope that helps ! Duy On Fri, Aug 28, 2020 at 9:09 AM Philip wrote: > I need a new

[R] Base package being deleted recurrently

2020-08-28 Thread Rene J Suarez-Soto
Hi, I have a very strange issue. I am currently running R 4.0.2. The files in my library/base/ are being deleted by some unknown reason. I have had to install R over 20 times in the last 2 month. I have installed using user privileges and admin. I have installed it to different directories but the

[R] PROBLEM: quickly downloading 10,000 articles to sift through

2020-08-28 Thread Fraedrich, John
To analyze 10,000+ articles within several journals to determine major theories used, empirical research of models, constructs, and variables, differences in standard definitions by discipline, etc. Is/does R have this in a software package? Sent from Mail

Re: [R] How to obtain individual log-likelihood value from glm?

2020-08-28 Thread John Smith
Thanks Prof. Fox. I am curious: what is the model estimated below? I guess my inquiry seems more complicated than I thought: with y being 0/1, how to fit weighted logistic regression with weights <1, in the sense of weighted least squares? Thanks > On Aug 28, 2020, at 10:51 PM, John Fox wrot

Re: [R] How to obtain individual log-likelihood value from glm?

2020-08-28 Thread John Fox
Dear John I think that you misunderstand the use of the weights argument to glm() for a binomial GLM. From ?glm: "For a binomial GLM prior weights are used to give the number of trials when the response is the proportion of successes." That is, in this case y should be the observed proportion

Re: [R] How to obtain individual log-likelihood value from glm?

2020-08-28 Thread Mark Leeds
Hii: It's been a long time but John Fox's "Companion to Appied Regression" book has the expressions for the likelihood of the binomial glm. ( and probably the others also ). Just running logLik is not so useful because it could be leaving out multiplicative factors. If you can get your hands on any

Re: [R] How to obtain individual log-likelihood value from glm?

2020-08-28 Thread John Smith
If the weights < 1, then we have different values! See an example below. How should I interpret logLik value then? set.seed(135) y <- c(rep(0, 50), rep(1, 50)) x <- rnorm(100) data <- data.frame(cbind(x, y)) weights <- c(rep(1, 50), rep(2, 50)) fit <- glm(y~x, data, family=binomial(), weight

Re: [R] Passing formula and weights error

2020-08-28 Thread John Smith
Thanks to Duncan and Bill for very helpful tips. On Fri, Aug 28, 2020 at 11:38 AM William Dunlap wrote: > Note that neither call to glm in your myglm function really works - > the first one is using the 'weights' object from the global > environment, not the weights argument. E.g., in the fresh

Re: [R] Passing formula and weights error

2020-08-28 Thread William Dunlap via R-help
Note that neither call to glm in your myglm function really works - the first one is using the 'weights' object from the global environment, not the weights argument. E.g., in the fresh R session, where I avoid making unneeded assignments and use fixed x and y for repeatability, > n <- 16 > d

Re: [R] Passing formula and weights error

2020-08-28 Thread Duncan Murdoch
This came up recently in a discussion of lm() on the R-devel list. I'd assume the same issue applies to glm. The problem is that the argument to weights is evaluated in the same way as arguments in the formula: first in data, then in the environment of the formula. The latter will eventuall

Re: [R] Would Like Some Advise

2020-08-28 Thread Jeff Newmiller
Linux supports process parallel processing with copy-on-write memory sharing (i.e. forking via mclapply) that makes certain kinds of algorithm parallelization much more memory-efficient. On August 28, 2020 7:45:12 AM PDT, Gregg via R-help wrote: >Phillip, > >The primary differences between Wi

Re: [R] how to create a sequence to consecutive values

2020-08-28 Thread Bert Gunter
Actually, I prefer Jeff's use of diff() . Hadn't thought of that. However, note that, unsurprisingly, NA's mess up both: The rle() method fails with an error and the diff() method gives the wrong answer. Cheers, Bert On Fri, Aug 28, 2020 at 8:48 AM Jeff Newmiller wrote: > cumsum is a bit fas

Re: [R] how to create a sequence to consecutive values

2020-08-28 Thread Jeff Newmiller
cumsum is a bit faster... a <- c( 0, 0, 0, 1, 1, 1, 1, 0, 0, 0 , 0, 1, 1, 0, 1, 1, 1, 0 ) f1 <- function(a) { z <- rle(a) v <- z$values v[v==1] <- seq_along(v[v==1]) ## or use cumsum rep(v,z$lengths) } f2 <- function(a) { v <- cumsum( c( a[1], 1==diff(a) ) ) v[ 0==a ] <-

[R] Passing formula and weights error

2020-08-28 Thread John Smith
Dear R-help: I am writing a function based on glm and would like some variations of weights. In the code below, I couldn't understand why the second glm function fails and don't know how to fix it: Error in eval(extras, data, env) : object 'newweights' not found Calls: print ... eval -> -> mode

Re: [R] how to create a sequence to consecutive values

2020-08-28 Thread Stefano Sofia
Thank you! Stefano (oo) --oOO--( )--OOo Stefano Sofia PhD Civil Protection - Marche Region Meteo Section Snow Section Via del Colle Ameno 5 60126 Torrette di Ancona, Ancona Uff: 071 806 7743 E-mail: stefano.so...@regione.marche.it ---Oo-oO _

Re: [R] how to create a sequence to consecutive values

2020-08-28 Thread Bert Gunter
Using ?rle > z <- rle(a) > v <- z$values > v[v==1] <- seq_along(v[v==1]) ## or use cumsum < rep(v,z$lengths) [1] 0 0 0 1 1 1 1 0 0 0 0 2 2 0 3 3 3 0 0 Cheers, Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Ber

[R] how to create a sequence to consecutive values

2020-08-28 Thread Stefano Sofia
Dear R-list users, this is a simple question, I have not been able to find an efficient solution. Given a vector with only 0 or 1 values, I need to give a sequence to the consecutive values of 1: a <- c(0,0,0,1,1,1,1,0,0,0,0,1,1,0,1,1,1,0,0) I should get as result (0,0,0,1,1,1,1,0,0,0,0,2,2,0,3

[R] Would Like Some Advise

2020-08-28 Thread Gregg via R-help
Phillip, The primary differences between Windows and Linux: Windows attempts to monetize most of what you do on your computer in the same way that Facebook, Google, and other Social Media sites go, but Microsoft goes one step further, and they use the OS to monetize Windows Users. Linux on the

[R] Would Like Some Advise

2020-08-28 Thread Philip
I need a new computer. have a friend who is convinced that I have an aura about me that just kills electronic devices. Does anyone out there have an opinion about Windows vs. Linux? I’m retired so this is just for my own enjoyment but I’m crunching some large National Weather Service files a

Re: [R] plot factors with dots in R

2020-08-28 Thread Deepayan Sarkar
On Thu, Aug 27, 2020 at 5:46 PM Luigi Marongiu wrote: > > Hello, > I have a dataframe as follows: > ``` > x = c("0 pmol", "10 pmol", "100 pmol", "1000 pmol") > y = c(0.9306, 1.8906, 2.2396, 2.7917) > df = data.frame(x, y) > > > str(df) > 'data.frame': 4 obs. of 2 variables: > $ x: chr "0 pmol"