Re: [R] create multiple categorical variables in a data frame using a loop

2018-04-19 Thread David Winsemius
> On Apr 19, 2018, at 1:22 PM, David Winsemius wrote: > > >> On Apr 19, 2018, at 11:20 AM, Ding, Yuan Chun wrote: >> >> Hi All, >> >> I want to create a categorical variable, cat.pfoa, in the file of pfas.pheno >> (a data frame) based on log2pfoa

Re: [R-es] Usuario en r-help

2018-04-19 Thread Javier Nieto
Muchas gracias Así lo haré, ya que recibí un tercer correo. Saludos De: miguel.angel.rodriguez.mui...@sergas.es Enviado: jueves, 19 de abril de 2018 04:21:07 p. m. Para: mac_j...@hotmail.com; r-help-es@r-project.org

Re: [R-es] Usuario en r-help

2018-04-19 Thread Javier Marcuzzi
Estimado Javier Nieto Ayer me llegaron dos o tres mensajes de esos, con diferencia de minutos, incluso pensé que los borré mal. El día de hoy no recibí ese tipo de mensajes, parecería que no los envía a todos o que yo logré bloquearlos colocando esas direcciones como no deseados, sin embargo

Re: [R-es] Resumen de R-help-es, Vol 110, Envío 15

2018-04-19 Thread Andrés Hirigoyen
t; autorizada. > > Nota: La información contenida en este mensaje y sus posibles documentos > adjuntos es privada y confidencial y está dirigida únicamente a su > destinatario/a. Si usted no es el/la destinatario/a original de este > mensaje, por favor elimínelo. La distribución o cop

Re: [R-es] Usuario en r-help

2018-04-19 Thread miguel.angel.rodriguez.muinos
Hola Javier. Esta dirección de correo no pertenece a la lista (ver imagen adjunta). Este tipo de "usuarios" los solemos banear para evitar spam, pero como la lista es de lectura abierta, pueden estar cogiendo correos y "contestándolos" (a tí directamente). Es mejor que crees una blacklist en

Re: [R-es] Interpretación NA's

2018-04-19 Thread Javier Nieto
Hola Javier Entiendo el punto y como bien comentas, lo que Carlos menciona es bastante l�gico. Aclaro la situaci�n: la segunda columna de precio(preciosCan) son de otro producto, contra el que estoy comparando, por lo cual no podr�a utilizarla para este fin en la regresi�n. Muchas gracias

Re: [R-es] Interpretación NA's

2018-04-19 Thread Javier Marcuzzi
Estimaod Javier Nieto Lo que dice Carlos Ortega tiene lógica, en ese aspecto su modelo podría modificar, desde lm(formula = ventas ~ precios, data = df) a lm(formula = ventas ~ precios + semana+ preciosCan , data = df) Pero sus precios y preciosCan son siempre iguales en el ejemplo que nos

Re: [R] create multiple categorical variables in a data frame using a loop

2018-04-19 Thread David Winsemius
> On Apr 19, 2018, at 11:20 AM, Ding, Yuan Chun wrote: > > Hi All, > > I want to create a categorical variable, cat.pfoa, in the file of pfas.pheno > (a data frame) based on log2pfoa values. I can do it using the following code. > > pfas.pheno <-within(pfas.pheno,

Re: [R] create multiple categorical variables in a data frame using a loop

2018-04-19 Thread Ding, Yuan Chun
Hi Rui, Thank you very much for your help!! It works very well, I got it. Ding -Original Message- From: Rui Barradas [mailto:ruipbarra...@sapo.pt] Sent: Thursday, April 19, 2018 11:35 AM To: Ding, Yuan Chun ; r-help@r-project.org Subject: Re: [R] create multiple

Re: [R] create multiple categorical variables in a data frame using a loop

2018-04-19 Thread Rui Barradas
Hello, When programming it is better to use dat[["variable"]] than dat$variable. So your code could be pfas.pheno[[cat.var]] <- NA pfas.pheno[[cat.var]][pfas.pheno[,i] <= quantile(pfas.pheno[,i],0.25, na.rm =T)] <- 0 etc. Untested. Hope this helps, Rui Barradas On 4/19/2018 7:20 PM,

[R] create multiple categorical variables in a data frame using a loop

2018-04-19 Thread Ding, Yuan Chun
Hi All, I want to create a categorical variable, cat.pfoa, in the file of pfas.pheno (a data frame) based on log2pfoa values. I can do it using the following code. pfas.pheno <-within(pfas.pheno, {cat.pfoa<-NA cat.pfoa[pfas.pheno$log2pfoa <=quantile(pfas.pheno$log2pfoa,0.25, na.rm =T)]<-0

Re: [R] Reasons to Use R in a Public Administrations and Ideas for a Short Training

2018-04-19 Thread Christopher W Ryan
A few years ago I gave two 5-hour workshops about R to a class of US high school students in a somewhat-accelerated science research class (so these were already science-motivated kids). They had been using mainly Excel, and some SPSS for which the school had a license. Overall they seemed to

Re: [R] Question

2018-04-19 Thread Olivier Crouzet
Hi, I think he's talking about how much a statistical estimator is influenced by extreme datapoints, e.g. https://en.m.wikipedia.org/wiki/Robust_statistics#Breakdown_point Olivier -- Olivier Crouzet Assistant Professor @LLING UMR6310 - Université de Nantes / CNRS Guest Scientist @UMCG -

Re: [R-es] Interpretación NA's

2018-04-19 Thread Carlos Ortega
Pues que la pequeña variación en las ventas no pueden explicarse con un precio constante. Hay otra variable que las explica o simplemente por un efecto aleatorio. De esta forma lo que sí que le puedes decir a negocio, es que si quieres entender la elasticidad de tus ventas, tienes que hacer algo

Re: [R] Syntax for capturing and writing file names

2018-04-19 Thread Rui Barradas
Hello, You can process several files at a time with repeated use of *appy functions. Something like the following (not tested). # This first instruction may not be needed old_dir <- setwd("path/to/txt/files") # Get the filenames in a vector and read them in txt_files <- list.files(pattern =

Re: [R-es] Interpretar intercepto de modelo ZINB

2018-04-19 Thread miriam . alzate
Muchas gracias por la respuesta! Miriam El Jue, 19 de Abril de 2018, 15:03, Freddy Omar López Quintero escribió: > Hola. > > Esta es una pregunta interesante porque, en mi caso, me hace preguntarme > hace cuánto tiempo no interpreto realmente un intercepto, no solo este > tipo > de modelos, sino

Re: [R] Reasons to Use R in a Public Administrations and Ideas for a Short Training

2018-04-19 Thread Thierry Onkelinx
Dear Lorenzo, First of all I would focus on topics which immediately usable by your audience. E.g. making figures and tables based on preprocessed data files (txt, Excel, GoogleSheets, data base query, ...). And pick examples in which the definition of the figures and tables remains more or less

[R] calculates the standard error with the delta method

2018-04-19 Thread A. Tafsir DIALLO via R-help
I need your help because I am having difficulties to finalize an econometric model.By the way, I want to calculate the standard error with delta method in a 2sls model with interactions under R.I want to determine the total effect of the institutions (Institutions + D_MinMond * Institutions) on

Re: [R] Event-triggered change in value with a time-delay

2018-04-19 Thread Hannah Meredith
Hi David, Thank you for your suggestion- I will look into it some more. Thanks again, Hannah On Wed, Apr 18, 2018 at 5:09 PM, David Winsemius wrote: > > > On Apr 18, 2018, at 1:04 AM, Hannah Meredith > wrote: > > > > Hello, > > > > I am solving

Re: [R-es] Interpretar intercepto de modelo ZINB

2018-04-19 Thread Freddy Omar López Quintero
Hola. Esta es una pregunta interesante porque, en mi caso, me hace preguntarme hace cuánto tiempo no interpreto realmente un intercepto, no solo este tipo de modelos, sino en cualquier modelo regresivo. ¡Hace mucho tiempo le presto solo atención atención los coeficientes de las variables! Ahora,

Re: [R] Question

2018-04-19 Thread Keith Jewell
On 15/04/2018 17:26, Marc Girondot via R-help wrote: Le 15/04/2018 à 17:56, alireza daneshvar a écrit : break-down point Can you explain more what you plan to do and give an example of what you have tried to do until now to do a "break down point" in R. Perhaps a "break down point" is

Re: [R] R Identifying columns with specific character

2018-04-19 Thread Julia Cabrera via R-help
FarnooshI want to start by appreciating your reply. Thank you so much. I am waiting to know your planwhy not give me pic [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see

[R] Syntax for capturing and writing file names

2018-04-19 Thread Neotropical bat risk assessments
Hi all, I am looking for syntax to read a list of *txt files, (loop through?) each with a different data content but same fields, then run lines of code to produce summary stats (I have working code for this) and add the matching data file name when writing the results of a line of R code.