similar to: Fwd: recodificar variables

Displaying 20 results from an estimated 400 matches similar to: "Fwd: recodificar variables"

2013 Nov 04
0
Fwd: recodificar variables
Hola Alexander. Para filtrar y obtener el subconjunto que necesitas, puedes hacerlo de la siguiente (una de ellas) manera: > Female <- subset(MathAchieve, subset=Sex=="Female") Crear una nueva variable recodificando "Sex" puedes hacerlo así: > Sex_recode <- Recode(MathAchieve$Sex, '"Female"=1; "Male"=0; ;', as.factor.result=TRUE) >
2012 May 12
2
Why can we combine design matrix and data-frame in R?
Hi all, Could you please help me? I am trying to understand why this line works: lm1x = lm(y~X-1, tmp) Here it seems that I was combining the design matrix and the data frame... And X below is not a single column, in fact, it's a bunch of columns in matrix form... I don't understand why this line works... Is it just luck, i.e. if we change the data-set and/or formulas to something
2003 Jun 25
3
joining columns as in a relational database
In our recent workshop on "Multilevel Modeling in R" we discussed handling data for multilevel modeling. An classic example of such data are test scores of students grouped into schools. We may wish to model the scores as functions of both student-level covariates and school-level covariates. Such data are often organized in a multi-table format with a separate table for each level of
2004 Jan 07
2
problem assigning an array to a variable in a data frame
Dear r-devel list members, Dirk Eddelbuettel brought the following problem to my attention. The code is abstracted from the appendix on mixed models from my R and S-PLUS Companion: > set.seed(12345) # for reproducibility > library(nlme) Loading required package: lattice > data(MathAchieve) > data(MathAchSchool) > attach(MathAchieve) > mses <- tapply(SES, School,
2012 Apr 03
4
Recodificar datos faltantes
Hola a todos La cuestión es una tontería, me gustaría recodificar los NA (valores faltantes) por el valor 0 He probado varias cosas del estilo: > hh<-c(2,3,4,NA,4) > replace(hh,which(hh==NA),0)->hh > hh [1] 2 3 4 NA 4 Conocéis alguna forma. Saludos
2002 May 02
2
problem with lme in nlme package
Dear R list members, I've turned up a strange discrepancy between results obtained from the lme function in the nlme package in R and results obtained with lme in S-PLUS. I'm using version 3.1-24 of nlme in R 1.4.1 under Windows 2000, and both S-PLUS 2000 and 6.0, again under Windows 2000. I've noticed discrepancies in a couple of instances. Here's one, using data from Bryk
2014 Mar 12
3
Sobreponer dos mapas
Hola, Estoy tratando de sobreponer un mapa sobre otro, uno que sirva de ?background? y otro con datos. Mi primer intento lo hice usando el paquete PBSmapping. Aquí lo que hice: library(PBSmapping) estados <- importShapefile(?Entidades_2013.shp") #Aquí cargamos las entidades federativas (32 entidades) zonas <- importShapefile(?zm.shp?) #Aquí cargamos las zonas metropolitanas del país
2011 Apr 16
2
AYUDA POR FAVOR
hola! podrian ayudarme con esto: Genere 1000 muestras aleatorias de tamaño n=10 de una población normal con media =2,5 y desviación 0,16. Con cada una de las muestras construya un intervalo de confianza al 95% para la media y para la varianza. Cuente que porcentaje de los 1000 intervalos atrapan la verdadera media y la verdadera varianza poblacional respectivamente. Comente los resultados
2017 Nov 06
3
Añadir filas hasta que se acabe un proceso
Buenas, Supongamos que tengo un data.frame con la siguietne forma: proceso fecha inicio fecha fin 1 2017/05/01 10:00 2017/05/01 14:00 2 2017/05/01 11:00 2017/05/01 12:00 3 2017/05/01 09:00 2017/05/01 15:00 Lo que quiero es trasnformar el data.frame en un data.frame que tenga la siguiente estructura
2017 Nov 06
2
Añadir filas hasta que se acabe un proceso
Gracias a todos Isidro, para esa solucion que planteas voy a complementarla con las fucniones de lubridate interval y %within%. Un saludo Jesús ________________________________ De: Isidro Hidalgo Arellano <ihidalgo en jccm.es> Enviado: lunes, 6 de noviembre de 2017 13:06 Para: 'Jesús Para Fernández'; r-help-es en r-project.org Asunto: RE: [R-es] Añadir filas hasta que se acabe un
2014 Mar 28
2
Filtrar columnas a partir de una lista
Buenas a todos, tenía este problema y no soy capaz de encontrar la solución, aunque me imagino que será una tontería. Mi intención es filtrar un marco de datos pero no por filas sino por columnas partiendo de una lista previa. Por ejemplo el filtro por filas podría ser de este tipo subset(x, x$ID%in%z$ID2==T) así logro facilmente filtrar datos por filas de otro marco de datos. Pero eso
2004 Dec 19
1
PBIB datataset
I'm looking at Pinheiro & Bates "Mixed-Effects Models in S and S-PLUS" at the moment. Several datasets are used, one of which is called "PBIB" (a partially balanced incomplete block design). All the other datasets can be found somewhere or other in R. However, I cannot locate PBIB, and it does not seem to be mentioned in the latest edition of the R Full Reference
2017 Feb 23
2
"IN" en data.table
Hola a todos. ¿Es posible filtrar casos en data.table por más de una categoría al mismo tiempo? Algo así como un IN o similar, dónde IN puede entenderse como "existe en": datos[Provincia IN c("CATAMARCA", "CHACO", "CORRIENTES"), FORM] O sea: una forma abreviada de hacer:
2009 Aug 09
1
problem adding columns to matrix
Hi all, i purchased a copy of the book Morphometrics with R by Springer. at the end of each chapter there are exercises to train what you just read and (hope) learned... so i have this problem: Define a hypothetical data frame containing five measurments normally distributed(size,head,pectoral,area,weight) for four individuals (named ind1, ind2, etc). ADD A COLUMN corresponding to the
2012 Oct 02
1
Parametric effects in GAM
Hello! Can anyone give a tip how to plot parametric effects in an Generalized Additive Model, from mgcv package? Thanks, PM
2017 Jul 19
4
remover y reemplazar
Se ha borrado un adjunto en formato HTML... URL: <https://stat.ethz.ch/pipermail/r-help-es/attachments/20170719/597123ea/attachment.html>
2017 Aug 02
2
problema al transformar columna tipo "factor" a tipo "numeric" en data.table
Se ha borrado un adjunto en formato HTML... URL: <https://stat.ethz.ch/pipermail/r-help-es/attachments/20170802/366301a6/attachment.html>
2018 May 31
2
CONVERSIÓN HORAS Y VECTORIZAR
Buen día, Agradezco su colaboración con lo siguiente: Tengo la variable a que contiene horas en excel, al importarla a R sube en formato deciilmal. POr ejemplo la hora en excel aparece "10:45:00 a. m." al importarla a R queda "0.4479167". He usado el paquete chron y he logrado convertirla y verla como requiero. Sin embargo al querer pasarla a un vector y unirla en mi
2011 Aug 31
6
Weights using Survreg
Dear R users, I have been trying to understand what the Weights arguments is doing in the estimation of the parameters when using the Surreg function. I looked through the function's code but I am not sure if I got it or not. For example, if I inclue the Surv function in it: survreg(Surv(vector, status)~1,weights=vector2,dist="Weibull") will it try to maximize the likelihood with
2004 Jan 12
1
extract data from a data.frame
Hi, I'm reading part of a table from postgres, so I'm getting a data frame. how can I extract the numerica values so I can operate on them. > res <- dbGetResult(mydata) > str(res) `data.frame': 5 obs. of 8 variables: $ cyx.1: num 0.149 -0.278 0.114 0.060 0.109 $ cyx.2: num 0.158 -0.070 0.063 0.149 0.150 $ cyx.3: num 0.052 -0.350 0.114 0.126 0.238