Re: [R] propensity scores & imputation

2017-03-16 Thread David Paul
Hi Mr. Gunter, Will do. Thanks, I've not visited stats.stackexchange before. Kind Regards, David -Original Message- From: Bert Gunter [mailto:bgunter.4...@gmail.com] Sent: Thursday, March 16, 2017 7:51 PM To: david.p...@statmetrics.biz Cc: R-help

Re: [R] propensity scores & imputation

2017-03-16 Thread Bert Gunter
Way out of bounds for this list (see the posting guide). Try posting on stats.stackexchange.com instead. Cheers, Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic

Re: [R] [FORGED] standard error for regression coefficients corresponding to factor levels

2017-03-16 Thread Rolf Turner
You have been posting to the R-help list long enough so that you should have learned by now *not* to post in html. Your code is mangled so as to be unreadable. A few comments: (1) Your data frame "data1" seems to have a mysterious (and irrelevant?) column named "data1" as well. (2) The

Re: [R] Transposing forecasts results from nnetar function and turn them into a data frame

2017-03-16 Thread Jim Lemon
Hi Paul, It looks like the information that is printed is in: TSModelForecast$mean If str(TSModelForecast$mean) returns something like a list with two components, you can probably use something like this: paste(format(TSModelForecast$mean$Date,"%b-%Y"),

Re: [R] Display data by condition

2017-03-16 Thread Juan Ceccarelli Arias
Thanks, but I already solved it as you wrote it. I was a missing comma. On Thu, Mar 16, 2017 at 5:19 PM, jim holtman wrote: > you are probably missing a comma: > > View(data[data$fact > 5000, ]) > > > Jim Holtman > Data Munger Guru > > What is the problem that you are trying

[R] propensity scores & imputation

2017-03-16 Thread David Paul
Hi, Many thanks in advance for whatever advice / input I may receive. I have a propensity score matching / data imputation question. The purpose of the propensity score modeling is to put subjects from two different clinical trials on a similar footing so that a key clinical measurement

Re: [R] Display data by condition

2017-03-16 Thread Juan Ceccarelli Arias
Thank you both. The issue was I didn't declare the database as a data frame and I also forgot the comma... ene=as.data.frame(data) attach(ene) View(ene[ene$fact>5000,]) The code listed did the trick I desired. Again, thanks I can say the problem is solved. On Thu, Mar 16, 2017 at 3:32 PM,

Re: [R] coeftest with covariance matrix

2017-03-16 Thread Achim Zeileis
On Thu, 16 Mar 2017, alfonso.carf...@uniparthenope.it wrote: Hi all, I want to ask you which is the difference between the specifyng and not specifyng the covariance matrix of the estimated coefficients when performing the coeftest command. coeftest(object, ...) computes Wald statistics

Re: [R] How to get the transpose of R´s function forecast output and turn it into a data frame

2017-03-16 Thread Jim Lemon
Hi Paul, As Peter noted, without knowing the structure of the the object, only a guess can be made. Mine is: fdf<-data.frame(Date=names(forecast),forecast=forecast) You may want to apply as.numeric to the names. Jim On Thu, Mar 16, 2017 at 11:43 PM, Paul Bernal

[R] coeftest with covariance matrix

2017-03-16 Thread alfonso . carfora
Hi all, I want to ask you which is the difference between the specifyng and not specifyng the covariance matrix of the estimated coefficients when performing the coeftest command. I'm estimating a VECM model and I want to test the significance of the short-run casual effects of the

Re: [R] Display data by condition

2017-03-16 Thread jim holtman
you are probably missing a comma: View(data[data$fact > 5000, ]) Jim Holtman Data Munger Guru What is the problem that you are trying to solve? Tell me what you want to do, not how you want to do it. On Thu, Mar 16, 2017 at 11:16 AM, Juan Ceccarelli Arias wrote: > Hello,

[R] Transposing forecasts results from nnetar function and turn them into a data frame

2017-03-16 Thread Paul Bernal
Dear friends, I am currently using R version 3.3.3 (64-bit) and used the following code to generate forecasts: > library(forecast) > > library(tseries) ‘tseries’ version: 0.10-35 ‘tseries’ is a package for time series analysis and computational finance. See

Re: [R] Display data by condition

2017-03-16 Thread Jeff Newmiller
Presuming "data" is a data frame because you have not provided a minimal reproducible example as requested in the Posting Guide... note also that "data" is the name of a function in base R, so that is a potentially troublesome variable name. A data frame is a list of vectors. It can be

[R] standard error for regression coefficients corresponding to factor levels

2017-03-16 Thread li li
Hi all, I have the following data called "data1". After fitting the ancova model with different slopes and intercepts for each region, I calculated the regression coefficients and the corresponding standard error. The standard error (for intercept or for slope) are all the same for different

Re: [R] ggplot2: Adjusting title and labels

2017-03-16 Thread Ulrik Stervbo
Hi Georg, If you remove the coord_polar, you'll see that the optimal y-value for the labels is between the upper and lower bound of the stacked bar-element. I am not sure it is the most elegant solution, but you can calculate them like this: df <- data.frame(group = c("Male", "Female",

Re: [R-es] Pregunta (debate) sobre licencia R

2017-03-16 Thread javier.ruben.marcuzzi
Francisco Recuerdo un caso en donde conocí a varios partícipes, básicamente se crea una empresa en Argentina con fondos y gran parte aportado por Italia. Esa asociación tiene 40 programadores, yo estuve con los gerentes reunidos y vi el lugar con las personas y las computadoras, me comentan

Re: [R] Display data by condition

2017-03-16 Thread Rui Barradas
Hello, Maybe you're missing a comma. (I'm assuming your dataset is a data.frame or a matrix.) Try View(data[data$fact>5000, ]) To give you a better answer you need to show us the output of str(data) And don't name your data 'data', it already is the name of an R function. And post in plain

Re: [R] HELP ME: Fill NA Values from the previous Non-NA Values

2017-03-16 Thread Allan Tanaka
Amazing! Thanks for your kindness. On Thursday, 16 March 2017, 20:38, PIKAL Petr wrote: Hi You can achieve exactly what you want by using ave/na.locf twice dat<-data.frame(ie=rep(letters[1:3], each=3), iw=rnorm(9)) dat[c(3, 4),2]<-NA > dat   ie          iw 1 

[R] Display data by condition

2017-03-16 Thread Juan Ceccarelli Arias
Hello, I need to show the observations of a data set only if the earn more than $5000 (fact is its name in the date set). I use this: View(data[data$fact>5000]) The code above shows nothing. No error or message at all. What am i doing wrong? Thanks for your help and time. [[alternative

[R] Error in roc.default(response, predictor, auc = TRUE, ...) : No valid data provided.

2017-03-16 Thread Allan Tanaka
Check my fitted dimension:str(predict(mod, Test1))   Named num [1:2131] 402 2346 1995 2205 2895 ... - attr(*, "names")= chr [1:2131] "1" "2" "4" "6" ... So i want to see AUC score for my model being applied into Test1data after having splitting total data (Train) into Train 1 and Test 1, but i

Re: [R] Quantiles with ordered categories

2017-03-16 Thread Martin Maechler
> > on Tue, 14 Mar 2017 21:54:42 +0100 writes: > I found it: > quantile(ordered(1:10), probs=0.5, type=1) > works, because type=1 seems to round up or down, whatever. The default option for is 7, which wants to interpolate, and then produces

Re: [R-es] Pregunta (debate) sobre licencia R

2017-03-16 Thread Carlos J. Gil Bellosta
Hola, ¿qué tal? Pues eso depende de lo que hayas firmado. Frecuentemente, el código pertenece la organización que paga su desarrollo. Si trabajas (con contrato laboral), casi seguro que el código pertenece a tu empleador. Si eres ajeno, depende. Pero lo normal es que: 1) Si el cliente se

Re: [R-es] Pregunta (debate) sobre licencia R

2017-03-16 Thread javier.ruben.marcuzzi
Estimado Francisco Rodríguez Hay cosas diferentes, una es usar el R con licencia “gratis” y otra con licencia “paga”. Por otro lado está el código que escribes, siempre es propiedad intelectual de quien lo escribe, ahora bien, si este lo publica haciéndolo público en internet estaría

[R-es] Pregunta (debate) sobre licencia R

2017-03-16 Thread Francisco Rodríguez
Hola buenos d�as, una pregunta que quiero realizar de R sobre el tema de la licencia y que me inquieta un poco, a ver si alguien me la puede responder de un modo suficientemente claro o referirme a alg�n sitio donde informarme porque yo por el momento estoy un poco liado. Imaginemos el

Re: [R] Test individual slope for each factor level in ANCOVA

2017-03-16 Thread li li
Hi John. Thanks much for your help. It is great to know this. Hanna 2017-03-16 8:02 GMT-04:00 Fox, John : > Dear Hanna, > > You can test the slope in each non-reference group as a linear hypothesis. > You didn’t make the data available for your example, so here’s an example >

[R] ggplot2: Adjusting title and labels

2017-03-16 Thread G . Maubach
Hi All, I have a question to ggplot 2. My code is the following: -- cut -- library(ggplot2) library(scales) df <- data.frame(group = c("Male", "Female", "Child"), value = c(25, 25, 50)) blank_theme <- theme_minimal() + theme( axis.title.x = element_blank(), axis.title.y =

Re: [R] screen

2017-03-16 Thread David L Carlson
Sorry. I focused on the table and not the record selection. Given the table this seems to be what you are looking for, but there may be an easier way: > keep <- which(t(apply(DF2.tbl, 1, cumsum)) > .01, arr.ind=TRUE) > keep <- keep[order(keep[, 1], keep[, 2]), ] > keep # These are the

Re: [R] add median value and standard deviation bar to lattice plot

2017-03-16 Thread Bert Gunter
Just add whatever further code to decorate the groups as you like within the panel.groups function. I believe I have given you sufficient information in my code for you to do that if you study the code carefully. Depending on what you decide to do -- which is statistical and OT here (and not

Re: [R] force axis to extend

2017-03-16 Thread David L Carlson
Use plot(NA, xlim=c(0, 5), ylim=c(-35, 35), type="n", axes=FALSE, ann=FALSE) to set up the length of the y axis instead of your first plot command. - David L Carlson Department of Anthropology Texas A University College Station, TX 77840-4352 -Original

Re: [R] screen

2017-03-16 Thread David L Carlson
Something like this? > DF2.agg <- aggregate(DF2$obs, DF2[, c("family", "time")], mean) > DF2.tbl <- xtabs(x~family+time, DF2.agg) > DF2.tbl time family WEEK1 WEEK2 WEEK3 WEEK4 A 0.00 0.50 0.50 0.00 B 0.67 0.00 0.50 0.00 C 0.00 0.00 0.00 1.00 You can get closer to

Re: [R] force axis to extend

2017-03-16 Thread Jen
Yay! That worked! Thanks so much! Jen On Thu, Mar 16, 2017, 9:28 AM David L Carlson wrote: > Use > > plot(NA, xlim=c(0, 5), ylim=c(-35, 35), type="n", axes=FALSE, ann=FALSE) > > to set up the length of the y axis instead of your first plot command. > >

Re: [R] force axis to extend

2017-03-16 Thread S Ellison
> Unfortunately, that doesn't work. The axis automatically scales to (-30, > 25, by 5). Your data do not extend to ±35 so the axis limits you have asked axis() for are outside the plot region. it is plot() that is (correctly) defaulting to the data range. if you want to override that to get a

Re: [R] HELP ME: Fill NA Values from the previous Non-NA Values

2017-03-16 Thread PIKAL Petr
Hi You can achieve exactly what you want by using ave/na.locf twice dat<-data.frame(ie=rep(letters[1:3], each=3), iw=rnorm(9)) dat[c(3, 4),2]<-NA > dat ie iw 1 a 1.07254438 2 a 0.53067188 3 a NA 4 b NA 5 b -0.09767088 6 b -1.02719060 7 c 2.35787246 8 c

Re: [R] force axis to extend

2017-03-16 Thread Jen
Hi Jim, Thanks for replying. Unfortunately, that doesn't work. The axis automatically scales to (-30, 25, by 5). Jen On Wed, Mar 15, 2017, 10:09 PM Jim Lemon wrote: > Hi Jen, > It seems way too simple, but does this work? > >

Re: [R] How to get the transpose of R´s function forecast output and turn it into a data frame

2017-03-16 Thread peter dalgaard
You're not giving us much to play with here. Reproducible example, please. (Remember to send it to the list, not me.) My immediate guess was cbind(), but without knowing the data structure, I can't tell for sure. -pd > On 16 Mar 2017, at 13:43 , Paul Bernal wrote: >

Re: [R] HELP ME: Fill NA Values from the previous Non-NA Values

2017-03-16 Thread Allan Tanaka
Hi. Thanks for the function. My bad, after looking at the csv file, it seems that NA values come not only from previous Non-NA values but also from the next Non-NA values. Example: | NCQ05 | 11.395 | | NCQ05 | 11.395 | | NCQ05 | | | NCQ06 | | | NCQ06 | 13 | | NCQ06 | 13 | If i use the

[R] How to get the transpose of R´s function forecast output and turn it into a data frame

2017-03-16 Thread Paul Bernal
Dear all, Hope you are doing great. Some R time series functions generate the forecasts in an horizontal way, for example: 2017 2018 20192020 forecast12 153575 but I´d like to have the output as follows: Date forecast 2017

Re: [R] Simulate data from Structural Equation Model

2017-03-16 Thread Troels Ring
Hi - running rseek.org with simulate structutral model data seems to give some inputs? BW Troels Den 16-03-2017 kl. 12:34 skrev Michael Haenlein: Dear all, I am looking for an R package or code that allows me to simulate data consistent with a given structural equation model. Essentially my

Re: [R] Test individual slope for each factor level in ANCOVA

2017-03-16 Thread Fox, John
Dear Hanna, You can test the slope in each non-reference group as a linear hypothesis. You didn’t make the data available for your example, so here’s an example using the linearHypothesis() function in the car package with the Moore data set in the same package: - - - snip - - - > library(car)

[R] Simulate data from Structural Equation Model

2017-03-16 Thread Michael Haenlein
Dear all, I am looking for an R package or code that allows me to simulate data consistent with a given structural equation model. Essentially my idea is to define (a) the number of endogenous and exogenous latent variables, (b) the strength of relationship between them and (c) the way of

Re: [R-es] R <- POO

2017-03-16 Thread javier.ruben.marcuzzi
Estimado Miguel Creo que no vale la pena discutir si es o no es orientado a objetos, hay otras preguntas: ¿Tiene capacidad de soportar POO? Si. ¿Tiene capacidad de programación funcional? Si, ayer pase un link del libre de Hadley Wickham que lo trata. Ahora otro lenguaje C#, C++, java,

Re: [R-es] R <- POO

2017-03-16 Thread miguel.angel.rodriguez.muinos
Sigo estando en desacuerdo contigo, Javier. R es, claramente, un lenguaje de Programación Orientado a Objetos (POO, OOP, o como quieras llamarlo). Maneja clases (con sus propiedades, métodos, propiedades, estados, ...), herencia, polimorfismo, Otra cosa es que quieras usar R de otra

Re: [R] mood.test/mood.medtest

2017-03-16 Thread peter dalgaard
> On 15 Mar 2017, at 16:32 , Leemann, Lucas T wrote: > > Hello, > > I was trying to test whether two medians are identical or not and used the > function “mood.test” from the “stats" package. My co-author, a medical > doctor, was trying to do the same in SPSS and had

Re: [R] HELP ME: Fill NA Values from the previous Non-NA Values

2017-03-16 Thread PIKAL Petr
Hi why nonumeric values in data identifier matters? Some toy data dat<-data.frame(ie=rep(letters[1:3], each=3), iw=rnorm(9)) dat[c(2, 4,6, 9),2]<-NA library(zoo) ave(dat$iw, dat$ie, FUN=function(x) na.locf(x, na.rm=FALSE)) You can use ave together with na.locf to propagate nonumeric values

Re: [R] add median value and standard deviation bar to lattice plot

2017-03-16 Thread Luigi Marongiu
dear Bert, thank you for the solution, it worked perfectly. However I still would like to know how reliable are the dots that are plotted, that is why i would like to have individual bars on each dot (if possible). the standard deviation maybe is not the right tool and the confidence interval is