similar to: Recoding several variables into one use the most recent data

Displaying 20 results from an estimated 400 matches similar to: "Recoding several variables into one use the most recent data"

2007 Jul 03
1
Please help with legend command
Hi R-ers: I'm drawing a plot and have used different line types (lty) for different race/ethnicity groups. I want a legend that explains what line types correspond to the different race/ethnicity groups. I used the following code: legend( 1992 , 42 , c("Hispanic" , "non-Hispanic white (NHW)" , "non-Hispanic black" , "AI/AN" , "Asian" ) ,
2002 Nov 26
1
Reshape by multiple variables
Dear list I'm using the reshape command and want to reshape a wide data set to a long one e.g. I have the variables y1,y2,y3,age1,age2,age3,sex,ethnic I want my new long data set to consist of the variables y (which has been created from y1,y2,y3), age (which has been created from age1,age2,age3), sex and ethnic I have tried to use the command:
2012 Jan 31
2
question on simple graph
I am having trouble generating a graph. I want to know the % of respondents who answered that they "strongly agree" or "agree" the "America owes R's ethnic group a better chance" (BTTRCHNC) and I want to organize it by racial group (RACESHRT). "BTTRCHNC" is organized ordinally from 1 through 5 with 1=Strongly Agree, 5=Strongly Disagree
2009 Jul 02
2
working with texts
WinXP, R-2.9.1 LS., I have been trying to solve a (for me) tricky issue. No matter what I've tried, I just can't find a way to do this. This is the issue: I have a text file (ansi text) "titles.txt" with lines of text; here is an example of such a file: >>>>> a brief history of polio vaccines anti-vaccination movements and their interpretations early warning
2008 Jan 07
1
recode() function results in logical output, not factor output
Dear R Users: I have race-ethnicity groups identified in the factor variable Ethnic_G. I need to collapse Ethnic_G into a new variable with only two factors, 1 (White, non-Hispanic) and 2 (Minority). As seen in the code and output below, the recoded race-ethnicity variable is put into logical format, not factor format. I've used library(car) and the package was updated. Any ideas on
2008 Aug 06
3
Help in running Stata dataset in R
Dear All, I installed R 2.7.0 and tried to call a dataset i had ealier own called on R2.6.2 but i keep on getting an error: use("maltreat.dta") Error in fromchar(x) : character string is not in a standard unambiguous format Tried doing the same with R2.7.1 but i get the same error. However if i call the same on R 2.6.2, there is no error: use("maltreat.dta") > des()
2012 Nov 26
1
Plotting an adjusted kaplan-meier curve
Dear R-users I am trying to make an adjusted Kaplan-Meier curve (using the Survival package) but I am having difficulty with plotting it so that the plot only shows the curves for the adjusted results. My data come from a randomised controlled trial, and I would like the adjusted Kaplan-Meier curve to only show two curves for the adjusted survival: one for those on treatment (Treatment==1)
2012 Nov 26
1
Plotting an adjusted survival curve
First a statistical issue: The survfit routine will produce predicted survival curves for any requested combination of the covariates in the original model. This is not the same thing as an "adjusted" survival curve. Confusion on this is prevalent, however. True adjustment requires a population average over the confounding factors and is closely related to the standardized
2007 Oct 27
2
Current value of object.method in helper
Hi, I am currently working to generate selection from my validation table where code and description pairs are stored. This works fine except when the current value is not exist in validation table. There are some old data which contains values that are no longer used and not in my validation table. I do not want to add old values in my validation table; however, I would like to display these
2010 Jun 28
2
Lattice and Beamer
Two things I think are some of the best developments in statistics and production are the lattice package and the beamer class for presentation in Latex. One thing I have not become very good at is properly sizing my visuals to look good in a presentation. For instance, I have the following code that creates a nice plot (sorry, cannot provide reproducible data).
2011 Nov 05
0
ANESRAKE package: Inappropriate error message, given the data
Hi, Attempting to use the "anesrake" raking (also referred to as rim weighting) package to weight survey data (Note: DATA is listed at the bottom along with SESSION INFO AND COMMANDS ARGUMENTS USED to allow you to reproduce the error). Presents following error message: *"Error in selecthighestpcts(discrep1, inputter, pctlim) : * * No variables are off by more than 5 percent using
2012 Nov 29
1
instrumental variables regression using ivreg (AER) or tsls (sem)
Dear friends, I am trying to understand and implement instrumental variables regression using R. I found a small (simple) example here which purportedly illustrates the mechanics (using 2-stage least-squares): http://www.r-bloggers.com/a-simple-instrumental-variables-problem/ Basically, here are the R commands (reproducible example) from that site: # ------ begin R library(AER)
2011 Jun 05
1
Negating two identical characters with regular expressions
Hello all, Let's say I have a character string "Race-ethnicity-----coding information" I want to extract all text before the multiple dashes, including the word "ethnicity." I wrote a handy function to extract the first matched text: grepcut <- function(pattern,x){ start.and.length <- regexpr(pattern,x) substring(x,start.and.length,start.and.length
2018 May 02
0
I am leaving llvm
You know, to this day I have never been able to bring myself to inform employers that I'm gay. The humiliation is just too much. It used to be that people hid homosexuality so they wouldn't get fired. Why should I have to disclose personal information just to satisfy some dumb diversity bureaucrat? For most of my 20s I was told I was a worthless over-privileged white male who deserved
2001 Jul 02
5
Nullsoft Vorbis Decoder v.1.11a Bug Report
Hi, there. While waiting for the encoder RC1, I will report some minor problems I experienced with Peter's Winamp decoder. First, I am using Nullsoft Vorbis Decoder v.1.11a with Winamp v.2.76 on Windows 98 SE. 1. When the buttons of Playlist Editor are extended, the part extended in playlist screen seems to be flickering when an Ogg file is being played. 2. I check the option of
2010 Feb 28
6
A slight trap in read.table/read.csv.
I had occasion recently to read in a one-line *.csv file that looked like: "CandidateName","NSN","Ethnicity","dob","gender" "Smith, Mary Jane",111222333,"E","2/25/1989","F" That "F" (for female) in the last field got transformed to FALSE. Apparently read.csv (and hence read.table) are inferring
2011 Jun 01
1
How to write random effect in MCMCglmm
Hi All, The data set that I have is a cluster data, and I want to run a HLM mixed model with multi-level response. Here is my data set: response: - Level (num: 1, 2, 3, 4, 5 - 5 levels) Covariates: - Type (Factor: A, B, C - 3 levels) - yr (num: 2006, 2007, ...) - Male (num: 0=not Male, 1=Male - 2 levels) - Ethnicity (Factor: A, B, H, ..., - 7 levels) - ELL (num: 0, 1, - 2
2018 Oct 16
2
Comprobar los nombres de columnas entre varios dataframes
Buenas tardes, Quiero aplicar la función rbind y necesito tener los mismos nombres de columnas. Como tengo unas 195 variables en cada dataframe, necesito hacerlo de una forma rápida. Tengo 9 bases de datos y tengo que fusionar todas. ¿Como puedo comprobar que los nombres de las variables son los mismos? Y de lo contrario, ¿como detecto las diferencias? He probado con
2015 Oct 13
2
RFC: Introducing an LLVM Community Code of Conduct
On Tue, Oct 13, 2015 at 08:20:33PM +0100, Renato Golin via llvm-dev wrote: > On 13 October 2015 at 19:30, Chandler Carruth <chandlerc at gmail.com> wrote: > > For some of the reasons we at least need to make it clear the scope: > > http://adainitiative.org/2014/02/18/howto-design-a-code-of-conduct-for-your-community/ > > Seems like a very personal opinion, and most
2009 Nov 09
2
Complicated For Loop (to me)
Hello, I'm trying to run a loop that will subset my data into specific sets by regions and by race/ethnicity. I'm trying to do this fairly compactly, and I cannot get this to work. A "simple" version of the code that I am trying to run is: names <- c("white", "black", "asian", "hispanic") for(j in names){ for(i in 1:9){