Re: [R] svykappa using the survey package

2016-06-20 Thread Anthony Damico
hi pradip, this should give you what you want library(foreign) library(survey) tf <- tempfile() download.file( " https://meps.ahrq.gov/mepsweb/data_files/pufs/h163ssp.zip; , tf , mode = 'wb' ) z <- unzip( tf , exdir = tempdir() ) x <- read.xport( z ) names( x )

Re: [R] Data aggregation

2016-06-20 Thread Bert Gunter
?tapply You should have encountered this already in most basic R tutorials. Have you gone through any? If not, you should. In particular,you need to learn about R's basic data structures (e.g. data frames). Alternatively, the dplyr package has many elegant tools for this sort of thing. You might

[R] svykappa using the survey package

2016-06-20 Thread Muhuri, Pradip (AHRQ/CFACT)
Hello, My goal is to calculate the weighted kappa measure of agreement between two factors using the R survey package. I am getting the following error message (the console is appended below; sorry no data provided). > # calculate survey Kappa > svykappa(~xbpchek53+xcholck53, design) Error

[R] Data aggregation

2016-06-20 Thread Paolo Letizia
Dear All: I have a data frame with 3 columns: "Regime", "Industry", and "Cost". I want to sum the value of "Cost" for each industry and "Regime". Example: The data frame is: Regime, Industry, Cost 10, 01, 370 11, 01, 400 10, 02, 200 10, 01, 500 11, 02, 60 10, 02, 30 I want the following output:

Re: [R] replacement has 0 rows, data has 2809

2016-06-20 Thread Jim Lemon
Hi Humberto, It may simply be that the file is C(omma)SV format and the default separator for read.delim is a TAB character. Try read.csv. Jim On Tue, Jun 21, 2016 at 2:14 AM, Humberto Munoz Barona wrote: > Hi Jim, > Thanks for your reply. length(lens) gives me 6, which

Re: [R] R help contingency table

2016-06-20 Thread Jim Lemon
Hi Lucie, You can visualize this using the sizetree function (plotrix). You supply a data frame of the individual choice sequences. # form a data frame of "random" choices coltrans<-data.frame(choice1=sample(c("High","Medium","Low"),100,TRUE), choice2=sample(c("High","Medium","Low"),100,TRUE))

Re: [R] R help contingency table

2016-06-20 Thread Lucie Dupond
Thank you for your answer ! I'm sorry, i've made a mistake in the second matrix, they should have the same row/column labels, I just used another label vector by mistake. My supervisor doesn't have a solution for this, and neither have every one I asked around me. Thanks for your solution,

Re: [R] patterns in numeric vector

2016-06-20 Thread Bert Gunter
Oops -- neglected to cc the list. Also note the correction at the end, changing "starts" to "begins". -- Bert On Mon, Jun 20, 2016 at 2:33 PM, Bert Gunter wrote: Thanks for the reproducible example -- it made your meaning clear. This is the sort of thing for which

[R] ASA Conference on Statistical Practice - deadline Thursday

2016-06-20 Thread Adams, Jean
R users, Abstracts are now being accepted for the ASA Conference on Statistical Practice February 23-25, 2017 Jacksonville FL, USA Past conference attendees have shown particular interest in R, reproducibility, and data visualization. The deadline for submission is June 23.

Re: [R] No reply from CRAN Task View: Graphic Displays & Dynamic Graphics & Graphic Devices & Visualization

2016-06-20 Thread Achim Zeileis
On Mon, 20 Jun 2016, Joseph Gama wrote: Hi all, I emailed a suggestion to Nicholas Lewin-Koh, the maintainer of the CRAN Task View: Graphic Displays & Dynamic Graphics & Graphic Devices & Visualization. I got no reply, so I wonder, is he still maintaining that view? If not, then who else

Re: [R] Generating input population for microsimulation

2016-06-20 Thread Dielia Ba
Hi everyone, I really need your help !! I am currently working on a micro-simulation project and I cannot find a package in R that does what I want. Here is the picture: I have macroeconomic variables such as income,consumption, household weight and I calculated the elasticities already. I

[R] No reply from CRAN Task View: Graphic Displays & Dynamic Graphics & Graphic Devices & Visualization

2016-06-20 Thread Joseph Gama
Hi all, I emailed a suggestion to Nicholas Lewin-Koh, the maintainer of the CRAN Task View: Graphic Displays & Dynamic Graphics & Graphic Devices & Visualization. I got no reply, so I wonder, is he still maintaining that view? If not, then who else does or will maintain it? BR, José Gama

[R] R crashed on Mips64 on executing library for certain package

2016-06-20 Thread Shashank Tadisina
Hi All, I was trying to get R cross-compiled for Mips64. The build system architecture I used is x86-64 while the system architecture to which R is cross-compiled to is Mips64 The below are the details of the mips64 system where I am running R ~ # uname -a Linux (none) 2.6.32.27-Cavium-Octeon

[R] patterns in numeric vector

2016-06-20 Thread C Lin
Hello, Can someone help me with this? I am trying to find the start and end positions in a vector where numbers less than x is surrounded by number(s) greater than x. For example: try = c(7,223,42,55,30,25,61,5,70) x=40 The desired output would be: > loc     start end 1 5  6 2    

Re: [R] R help contingency table

2016-06-20 Thread David L Carlson
You should consult with your adviser or someone at your institution who has more experience in statistical analysis than you do. You want to compare the matrices, but the row/column labels are different so you may be comparing completely different categories. Technically, you need to convert

Re: [R] loop testing unidentified columns

2016-06-20 Thread Brittany Demmitt
Thank you! > On Jun 20, 2016, at 12:41 PM, David L Carlson wrote: > > It does not test the first column, but a vector must have consecutive > indices. Since you did not assign a value, R inserts a missing value. If you > don't want to see it use > >> results.pc.all[, -1] >

Re: [R] merging df with world map

2016-06-20 Thread boB Rudis
you also don't need to do a merger if you use a base `geom_map()` layer with the polygons and another using the fill (or points, lines, etc). On Fri, Jun 17, 2016 at 5:08 PM, MacQueen, Don wrote: > And you can check what David and Jeff suggested like this: > > intersect(

Re: [R] loop testing unidentified columns

2016-06-20 Thread David L Carlson
It does not test the first column, but a vector must have consecutive indices. Since you did not assign a value, R inserts a missing value. If you don't want to see it use > results.pc.all[, -1] [,1] [,2] results.212 results.323 -

Re: [R] Error in setwd() : argument "dir" is missing, with no default

2016-06-20 Thread David L Carlson
You cannot use setwd() without an argument: > setwd() Error in setwd() : argument "dir" is missing, with no default If you want to choose a directory use choose.dir(). But if you are using RStudio, you can use the Files tab in the window on the lower right. Navigate to the folder/directory you

[R-es] Ayuda con la exportación de datos

2016-06-20 Thread Sebastián Rangel
Un saludo a todos Tengo un problema con la exportación de una serie de tiempo la cual le impute unos datos faltantes . He usado el comando write.table(datos1, "imputacion.csv",dec=".", sep=";",eol = "\r" ) Los datos salen bien en R > head(datos1) brent wti Fechas Fecha 1

[R] loop testing unidentified columns

2016-06-20 Thread Brittany Demmitt
Hello, I want to compare all of the columns of one data frame to another to see if any of the columns are equivalent to one another. The first column in both of my data frames are the sample IDs and do not need to be compared. Below is an example of the loop I am using to compare the two data

Re: [R] How to visualize this df

2016-06-20 Thread PIKAL Petr
Hi you still should post a snippet of your data to help others better understand. It should be something like p<- ggplot(dat, aes(x=Protocol, y=NRuns, fill=Speed)) p+geom_bar(stat="identity") But as you have 132 levels of protocol unless you have big big monitor you will have problems to

Re: [R] R help contingency table

2016-06-20 Thread S Ellison
> The first colomn is showing the first color, and the second is showing the > second color of the transition Are you sure? transitions1 is a 3x3 matrix; it has three columns, not two. Could it be that the columns are colour 2 following initial condition given by row, or vice versa? [not that

Re: [R] Error in setwd() : argument "dir" is missing, with no default

2016-06-20 Thread PIKAL Petr
Hi maybe it is feature of RStudio so you shall probably ask there. I use to start each project in a separate folder and I always start R by doubleclick on .RData icon. So for each project I have different .RData. Beware that Windows keeps you safe and usually hides files with dot at the

Re: [R] How to visualize this df

2016-06-20 Thread Rainer M Krug
writes: > Hi Rainer, Please keep this on the mailing list for info. > Thanks for your reply. I want to show NRuns for each Protocol in my df > and color it by Speed. I think it's possible by a bar chart but I am > confused how to subset my df for using Bar chart in

[R] gbresolve function from the geiger package

2016-06-20 Thread Nomi Hadar
Hello, I have troubles with the gbresolve function from the *geiger *package, which works with the NCBI taxonomy. When I use it, there are genera that are not found although they *do appear *in the NCBI taxonomy browser. for example, when

[R] R help contingency table

2016-06-20 Thread Lucie Dupond
Hello, I'm sorry if my question is really basic, but I'm having some troubles with the statistics for my thesis, and especially the khi square test and contingency tables. For what I understood, there are two "kinds" of khisquare test, that are quite similar : - Homogeneity, when we have one

Re: [R] Fwd: Matrix Constraints in R Optim

2016-06-20 Thread Priyank Dwivedi
All, Here are the dput files of the input data to the code. Thanks for any advice. I am adding the entire code below too just in case. file <- file.path("Learning R","CRM_R_Ver4.xlsx") file my.data <- readWorksheetFromFile(file,sheet=1,startRow=1) str(my.data) # DATA FRAME my.data.matrix.inj

[R] Error in setwd() : argument "dir" is missing, with no default

2016-06-20 Thread Shivi Bhatia
Dear Team, I have searched for this error at various forums but enable to find a relevant solution. When i had installed R studio the WD was saved at a particular location now when i try to change it gives me this error: Error in setwd() : argument "dir" is missing, with no default. I have

[R] frailtypack - Model did not converge

2016-06-20 Thread Andreu Ferrero
Hey, I am using "frailtyPenal" to fit a general joint model: I got a "Model did not converge" message, and I guess it is because I miss specify something in the command: "Call: frailtyPenal(formula = Surv(Time_final_mes_cor, BD_RE2.Re_IC1_cor) ~ cluster(BD_RE2.e_b_id) +

Re: [R] How to visualize this df

2016-06-20 Thread Rainer M Krug
"ch.elahe via R-help" writes: > Hi all, > I have a question about how to visualize my df! here is my df I need to > visualize: > > 'data.frame': 455 obs. of 128 variables: > $Protocol :Factor w/132 levels "_unknown","PD FS SAG","T1 SAG > FS","T2 FS OR",...

[R] How to visualize this df

2016-06-20 Thread ch.elahe via R-help
Hi all, I have a question about how to visualize my df! here is my df I need to visualize: 'data.frame': 455 obs. of 128 variables: $Protocol :Factor w/132 levels "_unknown","PD FS SAG","T1 SAG FS","T2 FS OR",... $NRuns : int 45 45 156 75 89 69 .. $Speed

[R] L1 penalized regression fails to predict from model

2016-06-20 Thread Fredrik Karlsson
Dear list, Sorry for this cross-post from StackOverflow, but I see that SO was maybe the wrong forum for this question. Too package specific and Ok, what I am trying to do is to predict from an L1 penalized regression. This falls due to a data set dimension problem that I cannot figure out. The

[R] (Off-Topic] Introducing a new R Blog

2016-06-20 Thread G . Maubach
Hi All, today I would like to announce a now R blog. I contains a few entries about the findings during my course of studies and my daily work: https://github.com/gmaubach/R-Know-How/wiki/R-Blog I hope you'll find my hints usefull. In addition you could have a look at a small R collection of