[R] quantile regression with complex survey data

2014-09-17 Thread Donia Smaali Bouhlila
Dear r Users, I am new in r. I am trying to estimate regression quantiles in complex surveys.I used these commands. mydesign -svydesign(ids=~IDSCHOOL,strata=~IDSTRATE,data=TUNISIA,nest=TRUE,weights=~TOTWGT) bootdesign - as.svrepdesign(mydesign,type=auto,replicates=150)

[R] How can I create colors correspond to the number of a variable?

2014-09-17 Thread wszsdmjj
I need to create a color vector with 4000 colors, and I have another variable, it contains 4000 element. If my variable is number of bed, and I want the color corresponds to the number of bed in this variable. How should I do? -- View this message in context:

[R] Training a model using glm

2014-09-17 Thread Mohan Radhakrishnan
I answered this question which was part of the online course correctly by executing some commands and guessing. But I didn't get the gist of this approach though my R code works. I have a training and test dataset. nrow(training) [1] 251 nrow(testing) [1] 82 head(training1) diagnosis

Re: [R] Error in predict.lm() for models without intercept?

2014-09-17 Thread Rolf Turner
What's going on is very simple. I apologize for not getting my thoughts organized from the start. Confidence bands for mu_y (the expected value of y) will have straight line edges if and only if there is a *single predictor* in the model. If there are two or more predictors the edges will

[R] RGtk2 drawing area as cairo device - no points

2014-09-17 Thread François Rebaudo
Hi, The following code adapted from Michael post (https://stat.ethz.ch/pipermail/r-help/2012-March/306069.html) works just fine on Linux Debian, but not on Windows 7 (no points on plots 2 and 3). More surprisingly, if the first plot is a boxplot, it works on both OS... and if I do a pdf (using

Re: [R] How can I create colors correspond to the number of a variable?

2014-09-17 Thread John McKown
First off, please post in plain text not HTML. It is a forum requirement. HTML posts are often ignored, especially if they look messy in plain text, which is all that the mailing list software distributes. It strips off the HTML portion entirely. Your question is vague in that you didn't indicate

Re: [R] How can I create colors correspond to the number of a variable?

2014-09-17 Thread Jim Lemon
On Tue, 16 Sep 2014 09:34:39 PM wszsdmjj wrote: I need to create a color vector with 4000 colors, and I have another variable, it contains 4000 element. If my variable is number of bed, and I want the color corresponds to the number of bed in this variable. How should I do? Hi wszsdmjj, I

[R] Control color palette and legend in filled.contour

2014-09-17 Thread Thiago V. dos Santos
Dear all, I am having some difficulties trying to control color palette and legend of a filled.countour plot. Basically, I am plotting volumetric soil moisture which ranges from 0 to 1 (although the data excerpt I'm providing here ranges from 0 to 0.4, my complete dataset ranges from 0 to

[R] NA from cut.Date

2014-09-17 Thread Benjamin Tyner
Hello, I'm wondering if this is expected? cut(structure(1, class=Date), structure(c(11100,1), class=Date)) [1] NA Levels: 2000-05-23 The help page says that for ‘Date’ objects, only ‘day’, ‘week’, ‘month’, ‘quarter’ and ‘year’ are allowed [for the 'breaks' argument]. Though

Re: [R] NA from cut.Date

2014-09-17 Thread Prof Brian Ripley
On 17/09/2014 12:04, Benjamin Tyner wrote: Hello, I'm wondering if this is expected? It is as documented! cut(structure(1, class=Date), structure(c(11100,1), class=Date)) [1] NA Levels: 2000-05-23 The help page says that for ‘Date’ objects, only ‘day’, ‘week’,

[R] column names to row names

2014-09-17 Thread eliza botto
Dear useRs, I have a data frame y starting from 1961 to 2010 in the following manner (where A,B,C .., I are station names and the values uder these are discharge values.) dput(y) structure(c(1961, 1961, 1961, 1961, 1, 1, 1, 1, 1, 2, 3, 4, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,

Re: [R] column names to row names

2014-09-17 Thread jim holtman
Use the 'tidyr' package: your 'month' does not match your desired output - x - structure(c(1961, 1961, 1961, 1961, 1, 1, 1, 1, 1, 2, 3 + , 4, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 + , 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27 + , 28, 29, 30, 31, 32, 33,

Re: [R] R write strange behavior in huge file

2014-09-17 Thread Stefan Evert (Mailing Lists)
You probably told R to write out the file as a single long line with fields separated alternately by 380 TABs and one newline � that�s what the ncol argument does (write is just a small wrapper around cat()). cat() doesn�t print lines that are longer than 2 GiB, so it will insert an extra \n

Re: [R] column names to row names

2014-09-17 Thread eliza botto
Thankyou very much jim. you always have something new for the R-ookies. Eliza Date: Wed, 17 Sep 2014 09:26:07 -0400 Subject: Re: [R] column names to row names From: jholt...@gmail.com To: eliza_bo...@hotmail.com CC: r-help@r-project.org Use the 'tidyr' package: your 'month' does not

[R] ANN ARIMA or ANN ES Examples ?

2014-09-17 Thread ce
Hello, I am looking for ANN ARIMA or ANN ES ( Artificial Neural Networks Hybrid with ARIMA or Exponential Smoothing ) R examples or packages ? as referenced in http://cs.uni-muenster.de/Professoren/Lippe/diplomarbeiten/html/eisenbach/Untersuchte%20Artikel/Zhan03.pdf regards

Re: [R] column names to row names

2014-09-17 Thread David L Carlson
Here's another approach using stack(): y - data.frame(y) E - with(y, data.frame(year, month, day, stack(data.frame(y), select=4:12))) colnames(E)[4:5] - c(discharge, station) But there are some differences. For my E: str(E) 'data.frame': 36 obs. of 5 variables: $ year : num

Re: [R] Error in predict.lm() for models without intercept?

2014-09-17 Thread peter dalgaard
On 17 Sep 2014, at 05:58 , isabe...@ghement.ca wrote: The example is based on a real data set (please keep it confidential), which is attached to this e-mail as mod.data.csv. Don't worry, it will stay between you two and the Internet (Actually, the list software seems to have

Re: [R] Efficient frontier

2014-09-17 Thread John Kane
https://github.com/hadley/devtools/wiki/Reproducibility http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example John Kane Kingston ON Canada -Original Message- From: aparna.ec...@gmail.com Sent: Mon, 15 Sep 2014 14:40:37 -0500 To: r-help@r-project.org

Re: [R] Training a model using glm

2014-09-17 Thread Mohan Radhakrishnan
Hi Dennis, Why is there that warning ? I think my syntax is right. Isn't it not? So the warning can be ignored ? Thanks, Mohan On Wed, Sep 17, 2014 at 9:48 PM, Dennis Murphy djmu...@gmail.com wrote: No reproducible example (i.e., no data) supplied, but the following

[R] Generating unordered, with replacement, samples

2014-09-17 Thread Giovanni Petris
Hello, I am trying to interface in my teaching some elementary probability with Monte Carlo ideas. In sampling from a finite population, the number of distinct samples of size 'k' from a population of size 'n' , when individuals are selected with replacement and the selection order does not

Re: [R] Generating unordered, with replacement, samples

2014-09-17 Thread Rui Barradas
Hello, Try function ?sample. Something like, if 'x' is a vector of size n, sample(x, k, replace = TRUE) If you want indices into 'x', try instead sample(n, k, replace = TRUE) Hope this helps, Rui Barradas Em 17-09-2014 19:25, Giovanni Petris escreveu: Hello, I am trying to interface in

Re: [R] Training a model using glm

2014-09-17 Thread Max Kuhn
You have not shown all of your code and it is difficult to diagnose the issue. I assume that you are using the data from: library(AppliedPredictiveModeling) data(AlzheimerDisease) If so, there is example code to analyze these data in that package. See ?scriptLocation. We have no idea how

Re: [R] Generating unordered, with replacement, samples

2014-09-17 Thread Giovanni Petris
Thank you, Rui, but I have the feeling that in this way you are drawing uniformly *ordered* samples, and you get a bias if you consider them to be unordered. Best, Giovanni From: Rui Barradas [ruipbarra...@sapo.pt] Sent: Wednesday, September 17, 2014

Re: [R] Generating unordered, with replacement, samples

2014-09-17 Thread Duncan Murdoch
On 17/09/2014 2:25 PM, Giovanni Petris wrote: Hello, I am trying to interface in my teaching some elementary probability with Monte Carlo ideas. In sampling from a finite population, the number of distinct samples of size 'k' from a population of size 'n' , when individuals are selected with

Re: [R] Generating unordered, with replacement, samples

2014-09-17 Thread Duncan Murdoch
On 17/09/2014 3:07 PM, Duncan Murdoch wrote: On 17/09/2014 2:25 PM, Giovanni Petris wrote: Hello, I am trying to interface in my teaching some elementary probability with Monte Carlo ideas. In sampling from a finite population, the number of distinct samples of size 'k' from a population of

Re: [R] Generating unordered, with replacement, samples

2014-09-17 Thread Giovanni Petris
Hi Duncan, You are right. The idea of the derivation consists in 'throwing' k placeholders (* in the example below) in the list of the individuals of the population. For example, if the population is letters[1:6], and the sample size is 4, the following code generates uniformly a 'sample'.

Re: [R] Generating unordered, with replacement, samples

2014-09-17 Thread Duncan Murdoch
On 17/09/2014 3:46 PM, Giovanni Petris wrote: Hi Duncan, You are right. The idea of the derivation consists in 'throwing' k placeholders (* in the example below) in the list of the individuals of the population. For example, if the population is letters[1:6], and the sample size is 4, the

[R] package ape read.dna diploid input data

2014-09-17 Thread Sarah Signor
I am fundamentally not understanding something about how this is set up, but after a few hours of googling I am going to ask and I apologize if its quite basic. I have sanger data that I am reading into ape with read.dna. x-read.dna(/Volumes/Storage/file.phy, format = interleaved) It has IUPAC

[R] Pseudo R squared for quantile regression with replicates

2014-09-17 Thread Donia Smaali Bouhlila
Hi, I am running quantile regressions with replicates, but I don't know how to calculate the Pseudo R squared for quantile regression with replicates. I have used the following commands: rho - function(u,tau=.5)u*(tau - (u 0)) V - sum(rho(fit$resid, fit$tau)) where fit is my

[R] plots on log=y scale with smooths

2014-09-17 Thread Michael Friendly
In the following example, I am trying to plot a response on a log scale, and add one or more smoothed curves, e.g., lowess and abline. In base graphics, I'd like to do this using log=y, so that the Y axis is spaced on the log scale, but labeled as the actual response values. Using ggplot2, I'm

[R] svyby and vcov function problem (Survey Package)

2014-09-17 Thread Daniela Droguett
Hi all, I would like to apply the vcov function from the survey package for the variables api00 and api99 grouped by the stype variable which can assume H, M and E categories (see below) I have tried svyby but as far as I know covariant matrices don't work with this function ​ In the code

Re: [R] gplot heatmaps: clustering according to rowsidecolors + key.xtickfun

2014-09-17 Thread Gregory R. Warnes
Hello Tim, Sorry about the slow response, I just found this message. On Sep 4, 2014, at 9:23 AM, Tim Richter-Heitmann trich...@uni-bremen.de wrote: Hi there, I have two questions about heatmap.2 in gplot. My input is a simple square matrix with numeric values between 75 and 100 (it is a

Re: [R] column names to row names

2014-09-17 Thread eliza botto
Thanyou David!!! :) From: dcarl...@tamu.edu To: jholt...@gmail.com; eliza_bo...@hotmail.com CC: r-help@r-project.org Subject: RE: [R] column names to row names Date: Wed, 17 Sep 2014 14:04:52 + Here's another approach using stack(): y - data.frame(y) E - with(y, data.frame(year,

Re: [R] NA from cut.Date

2014-09-17 Thread Benjamin Tyner
Thanks Brian! The confusion was due to my failure to notice that these two functions have opposite defaults for 'right': args(cut.default) function (x, breaks, labels = NULL, include.lowest = FALSE, right = TRUE, dig.lab = 3L, ordered_result = FALSE, ...) args(cut.Date)

Re: [R] Generating unordered, with replacement, samples

2014-09-17 Thread Giovanni Petris
Thank you! That does exactly what I was looking for. Best, Giovanni From: Duncan Murdoch [murdoch.dun...@gmail.com] Sent: Wednesday, September 17, 2014 15:02 To: Giovanni Petris; r-help@R-project.org Subject: Re: [R] Generating unordered, with

Re: [R] plots on log=y scale with smooths

2014-09-17 Thread David Winsemius
On Sep 17, 2014, at 4:34 PM, Michael Friendly wrote: In the following example, I am trying to plot a response on a log scale, and add one or more smoothed curves, e.g., lowess and abline. In base graphics, I'd like to do this using log=y, so that the Y axis is spaced on the log scale, but

Re: [R] gplot heatmaps: clustering according to rowsidecolors + key.xtickfun

2014-09-17 Thread Gregory Warnes
Oops, I forgot to mention that an bug was preventing RowSideColors from working properly. It is fixed in version 2.14.2 of gplots which I've just uploaded to CRAN and am attaching to this email. -Greg On Wed, Sep 17, 2014 at 5:12 PM, Gregory R. Warnes g...@warnes.net wrote: Hello Tim, Sorry