similar to: Non-Parametric Adventures in R

Displaying 20 results from an estimated 4000 matches similar to: "Non-Parametric Adventures in R"

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
2012 Dec 03
2
Excluding all missing values with dcast ("reshape2" package)
Hello--I'm doing a simple crosstab using dcast: rawfreq <- dcast(nh11brfs, race3~CHCCOPD, length) with the results race3 Yes No NA 1 White non-Hispanic 446 5473 21 2 Other non-Hispanic 29 211 0 3 Hispanic 6 81 1 4 <NA> 10 83 1 How would I modify this call to exclude all missing values; that is, to obtain race3
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
2009 Jun 04
4
Binning or grouping data
Newbie here. Many apologies in advance for using the incorrect lingo. I'm new to statistics and VERY new to R. I'm attempting to "group" or "bin" data together in order to analyze them as a combined group rather than as discrete set. I'll provide a simple example of the data for illustrative purposes. Patient ID | Charges | Age | Race 1 |
2010 Jul 02
1
help with the xtable package
HI, Dear R community, I am using the xtable to create the table, but how can I see the table? The following is the codes I used: > data(tli) > tli.table <- xtable(tli[1:10, ]) > digits(tli.table)[c(2, 6)] <- 0 > print(tli.table, floating = FALSE) % latex table generated in R 2.11.0 by xtable 1.5-6 package % Thu Jul 1 20:43:43 2010 \begin{tabular}{rrlllr} \hline &
2010 Mar 25
3
Returning Data Frame from Function for use Outside Function
I have a function (see below) that does some bootstrapping (I am happy to expand offline why I could use existing functions.) I put my results into and empty matrix and add a row of results with each iteration. My problem is i am a new user to R and I don't understand data frames, matrices, elements, and vectors well. What I would like is to have a data frame I can manipulate outside of the
2017 Jul 09
2
Help with ftable.svyby
Hi all, When I try the following with pkg Survey it returns the error below: ftable(svyby(~INCOME, ~AGECL+RACECL, svymean, design=q50), rownames=list(AGECL=c("<35", "35-44", "45-54", "55-64", "65-74", ">=75"), RACECL=c("white non hispanic", "non white or
2009 Oct 31
1
Help me improving my code
Hi, I am new to R. My problem is with the ordered logistic model. Here is my question: Generate an order discrete variable using the variable wrwage1 = wages in first full calendar quarter after benefit application in the following way: * wage*1*Ordered *= 1 *if*0 *· wrwage*1 *< *1000 2 *if*1000 *· wrwage*1 *< *2000 3 *if*2000 *· wrwage*1 *< *3000 4 *if*3000 *· wrwage*1 *<
2009 Oct 02
3
Tabulating using arbitrary numbers of factors
Dear R-help, First of all, thank you VERY much for any help you have time to offer. I greatly appreciate it. I would like to write a function that, given an arbitrary number of factors from a data frame, tabulates the number of occurrences of each unique combination of the factors. Cleary, this works: > table(horse,date,surface) <SNIP> , , surface = TURF
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" ) ,
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){
2017 Jul 09
0
Help with ftable.svyby
try resetting your factor levels and re-run? q50 <- update( q50 , INCOME = factor( INCOME ) , AGECL = factor( AGECL ) , RACECL = factor( RACECL ) ) On Sun, Jul 9, 2017 at 2:59 PM, Orsola Costantini via R-help < r-help at r-project.org> wrote: > Hi all, > > When I try the following with pkg Survey it returns the error below: > > ftable(svyby(~INCOME, ~AGECL+RACECL,
2007 Oct 28
1
tree problem
I am trying to use tree to partition a data set. The data set has 3924 observations. Partitioning seems to work for small subsets of the data, but when I use the entire data set, no partitioning occurs. The variables are: RESP respondent to a survey (0 = not a respondent, 1 = respondent) AGE_P Age (continuous) ORIGIN_I Hispanic Ethnicity (1 = Hispanic, 2 = non-Hispanic) RACRECI2 Race
2008 Sep 23
3
odds ratio: how to create reference
HI there, i know this is a basic question, though i need some help because this is somewhat away from my current issue, but nevertheless interesting to me... Lets assume i have some estimated probabilities, say estimated by a logit model. i know i can also state them as an odds ratio. Now i?d like to state these odds ratios as a reference to a specific outcome of my investigated
2004 Mar 09
1
More factor names in x axis, how?
I have some data which records, amongst other things, age (recoded by me to be in months), and drug group (a factor). The drug group is a 2 digit number, but there is no numeric relationship, and only 50 of the possible groups occur So > asd <- read.table("asd.dat", header=TRUE) > asd$group <- as.factor(asd$group) > plot(age ~ group, data=asd) gives me a series of
2008 Nov 17
1
Type III ANOVA of package car depends on factor level order
## Question1: How to define IV with interaction alone, without main effects? ## Question2: Should Type III ANOVA in package car be independent of the factor level order? ## data from http://www.otago.ac.nz/sas/stat/chap30/sect52.htm drug <- c(t(t(rep(1,3)))%*%t(1:4)); disease <- c(t(t(1:3)) %*% t(rep(1,4))); y <- t(matrix(c( 42 ,44 ,36 ,13 ,19 ,22 ,33 ,NA ,26 ,NA ,33 ,21 ,31 ,-3 ,NA
2006 Jul 07
4
How to change the type of segments ends?
Hi, I am trying to plot odds ratios and the corresponding confidence intervals in horizontal segments. It would be ideal if the confidence interval segment can be drawn with little vertical bars at both ends. I have tried very hard to change the type of ends by using 'lend' arguments, but cannot make it. I even tried 'arrows()', but still failed. Following is the code I use:
2018 May 04
2
Regression model fitting
Hi all , I have a dataframe (Hypertension) with following headers :- > Hypertension ID Hypertension(before drug A) Hypertension(On drug A) On drug B? Healthy diet? 1 160 90 True True 2 190
2012 Mar 20
2
Reshaping data from long to wide without a "timevar"
Hello All, I was wondering if it's possible to reshape data from long to wide in R without using a "timevar". I've pasted some sample data below along with some code. The data are sorted by Subject and Drug. I want to transpose the Drug variable into multiple columns in alphabetical order. My data have a variable called "RowNo" that functions almost like a
2017 Jul 26
3
How long to wait for process?
UseRs, I have a dataframe with 2547 rows and several hundred columns in R 3.1.3. I am trying to run a small logistic regression with a subset of the data. know_fin ~ comp_grp2+age+gender+education+employment+income+ideol+home_lot+home+county > str(knowf3) 'data.frame': 2033 obs. of 18 variables: $ userid : Factor w/ 2542 levels