[R] Automating the running of MVLN model in R using R2WinBUGS

2013-07-01 Thread Anamika Chaudhuri
Hi: To test the situation below I am creating 2 datasets .#Set working directory setwd("C://Tina/USB_Backup_042213/Testing/CSV") matrix=NULL csvs <- paste("MVN", 1:2, ".csv", sep="") for(i in 1:length(csvs)){ matrix[[i]] <- read.csv(file=csvs[i], header=T) print(matrix[[i]]) } So now I have

Re: [R] subset of factors in a regression

2013-07-01 Thread Ben Bolker
Philip A. Viton osu.edu> writes: > suppose "state" is a variable in a dataframe containing abbreviations > of the US states, as a factor. What I'd like to do is to include > dummy variables for a few of the states, (say, CA and MA) among the > independent variables in my regression formula. (T

Re: [R] KalmanForecast (stats)

2013-07-01 Thread Bert Gunter
Below... On Mon, Jul 1, 2013 at 7:24 PM, Giovanni Petris wrote: > > Oops... > > Correction: The function KalmanForecast does exist in package stats. > > The references that I gave in my other reply are still valid, though. It is > my impression that Kalman filtering facilities in stats are not m

Re: [R] KalmanForecast (stats)

2013-07-01 Thread Hasan Diwan
On 1 July 2013 19:24, Giovanni Petris wrote: > Could you send me a simple example of KalmanForecast (with input data) that I > can run and can see how it works exactly? There's an explanation of the Kalman Filter available at http://www.swarthmore.edu/NatSci/echeeve1/Ref/Kalman/ScalarKalman.html

Re: [R] KalmanForecast (stats)

2013-07-01 Thread Giovanni Petris
Oops... Correction: The function KalmanForecast does exist in package stats. The references that I gave in my other reply are still valid, though. It is my impression that Kalman filtering facilities in stats are not meant to be used directly by the end user of R, but their main purpose is to

Re: [R] KalmanForecast (stats)

2013-07-01 Thread Giovanni Petris
Gabriella, There is no function "KalmanForecast" in package stats, so I am not quite sure about what you are talking about. That said, it may help a review paper that I wrote a couple of years ago about the different packages available in R for state space modeling (Petris & Petrone, State spa

[R] Fwd: functions and matrices

2013-07-01 Thread David Winsemius
With permission I offer this exchange. Rolf and I have different notions of what u %*% v should mean, but the arbiter is obviously the original poster: Begin forwarded message: > From: David Winsemius > Subject: Re: [R] functions and matrices > Date: July 1, 2013 6:21:09 PM PDT > To: Rolf Turn

Re: [R] similarity and dissimilarity index

2013-07-01 Thread Rolf Turner
On 02/07/13 11:46, Khasro Abdulrahman Ismael wrote: Hallo every one I have this table and tried to find similarity and dissimilarity index in r by vegan package but I couldn't. I really don't know why I couldn't as I spend a lot of time working on it, so would you be so kind to calculate or giv

[R] similarity and dissimilarity index

2013-07-01 Thread Khasro Abdulrahman Ismael
Hallo every one I have this table and tried to find similarity and dissimilarity index in r by vegan package but I couldn't. I really don't know why I couldn't as I spend a lot of time working on it, so would you be so kind to calculate or give me some advise about my problem?   Ismael, Khasro A

Re: [R] functions and matrices

2013-07-01 Thread David Winsemius
On Jul 1, 2013, at 3:32 PM, Rolf Turner wrote: > > Basically R does things *numerically* and what you want to do really > amounts to symbolic manipulation. Of course R could be cajoled into > doing it --- see fortune("Yoda") --- but probably only with a great deal of > effort and code-writing.

Re: [R] functions and matrices

2013-07-01 Thread Rolf Turner
Basically R does things *numerically* and what you want to do really amounts to symbolic manipulation. Of course R could be cajoled into doing it --- see fortune("Yoda") --- but probably only with a great deal of effort and code-writing. OTOH you could quite easily write a function that would c

[R] Trying to predict from a time series with Additive Outliers: Error in as.matrix(newxreg) %*% coefs[-(1L:narma)] : non-conformable arguments

2013-07-01 Thread Andrew W. Swift
Hi, I am trying to work through an example in Cryer & Chan's book with regards to an ARIMA model with Interventions and Outliers The model fit is: m=arimax(log(airmiles),order=c(0,1,1),seasonal=list(order=c(0,1,1),period=12),xtransf=data.frame(I911=1*(seq(airmiles)==69), I911a=1*(seq(airmiles

[R] subset of factors in a regression

2013-07-01 Thread Philip A. Viton
suppose "state" is a variable in a dataframe containing abbreviations of the US states, as a factor. What I'd like to do is to include dummy variables for a few of the states, (say, CA and MA) among the independent variables in my regression formula. (This would be the equivalent of, creating

[R] Optimum of lm

2013-07-01 Thread ben1983
Hi All, I am trying to do some D o E. I would like to find the optima (maxima) of a 2 dimensional lm with quadratic terms. I'm sure there is a really simple solution but i can't find it. Also would there be any way to find some sort of confidence limits on these optima? Any help most app

Re: [R] Lee carter model

2013-07-01 Thread Jeff Newmiller
The Posting Guide warns you to not post in HTML format (it messes up R code examples). It also warns you to supply reproducible examples (we should be able to paste your code into a fresh R session and see essentially what you see). The warning message means you have given the function a factor

Re: [R] Bhattacharyya in R

2013-07-01 Thread Jeff Newmiller
There is a built-in guide to syntax called the help system. If you have read it you should be able to be mitre specific with your questions. I had never heard of this function. Your example code is not reproducible, nor does it indicate what result you got from running it. I used RSiteSearch("

[R] Bhattacharyya in R

2013-07-01 Thread Dzu
Dear R-user, I am trying to apply bhattacharyya-distance function to my data. Did anybody use it before ? My code is the following #Bhattacharya Distance measure #a and b are vectors a <- (1,2,3,4,2,2,2,2,2,2,2,1,4,5,6,-1,-1,-1,-1,-1,-3,-3,-3) b <- (1.1,1.1,1.2,1.2,1.2,1.2,1.2,2.1,2.1,2.2,2.2,2,

Re: [R] writing to the screen and extra "0"

2013-07-01 Thread Berend Hasselman
On 01-07-2013, at 21:03, Thomas Grzybowski wrote: > Hi. > > list.files(pattern = "*") > > gives me output with the R list indices at the left of each line on the > screen. I want only file names. > cat(list.files(pattern = "*"),sep="\n") Berend > Thanks! > Tom Grzybowski > > > On 07/01

Re: [R] writing to the screen and extra "0"

2013-07-01 Thread Charles Determan Jr
Hi Thomas, If you put the list.files statement inside the write function you won't have the indices. Try: write(list.files(pattern="*"), file="my_files.txt") Cheers, Charles On Mon, Jul 1, 2013 at 2:03 PM, Thomas Grzybowski < thomasgrzybow...@gmail.com> wrote: > Hi. > > list.files(pattern =

Re: [R] writing to the screen and extra "0"

2013-07-01 Thread Thomas Grzybowski
Hi. list.files(pattern = "*") gives me output with the R list indices at the left of each line on the screen. I want only file names. Thanks! Tom Grzybowski On 07/01/2013 02:55 PM, Rui Barradas wrote: Hello, Try instead list.files(pattern = "*") Hope this helps, Rui Barradas Em 01-

Re: [R] Missing data problem and ROC curves

2013-07-01 Thread David Winsemius
On Jul 1, 2013, at 10:57 AM, tfj24 wrote: > Hello all, > > Trying to get this piece of code to work on my data set. It is from > http://www.itc.nl/personal/rossiter. > > logit.roc <- function(model, steps=100) > { > field.name <- attr(attr(terms(formula(model)), "fac

Re: [R] writing to the screen and extra "0"

2013-07-01 Thread Rui Barradas
Hello, Try instead list.files(pattern = "*") Hope this helps, Rui Barradas Em 01-07-2013 19:23, Thomas Grzybowski escreveu: I am using the "write" function like so (R 3.0.1 on linux): "wrt" <- function() { write(system("ls *"),file="") } When the files are listed to the screen with

[R] writing to the screen and extra "0"

2013-07-01 Thread Thomas Grzybowski
I am using the "write" function like so (R 3.0.1 on linux): "wrt" <- function() { write(system("ls *"),file="") } When the files are listed to the screen with wrt(), there is a "0" character prepended to the output on the screen. Worse, when I remove the 'file=""' argument to "write", a

[R] functions and matrices

2013-07-01 Thread Naser Jamil
Dear R-user, May I seek your help, please. I have two matrices, u and v, elements of which are some functions of x. I just want to multiply them and express the determinant of the resulting matrix as a function of x and of course, this is for some reason. Actually the original problem has more matr

[R] Lee carter model

2013-07-01 Thread ntamjo achille
Hi everybody, I'm running codes for for a Lee carter modeling. I compute the demogdata function in the package demography.  Age is a class of factor Base<-demogdata(data=x,pop=y,ages=AGE,years=YEAR,type="mortality",label="City",name="Hommes",lambda=1)   Now, I try to run codes for lee carter mod

[R] Dunnett's T3 test (DTK package) problem

2013-07-01 Thread Sam Mak
Hello, I would like to ask a question about using DTK.test() to do the T3 test. The data file is downloadable here: http://ubuntuone.com/0zBl8QgUg1lAG6iK1CUicD My question is: in the result of T3 test, is it possible for the following three statements to hold without conflict? 1. m_a and m_b to

[R] Missing data problem and ROC curves

2013-07-01 Thread tfj24
Hello all, Trying to get this piece of code to work on my data set. It is from http://www.itc.nl/personal/rossiter. logit.roc <- function(model, steps=100) { field.name <- attr(attr(terms(formula(model)), "factors"), "dimnames")[[1]][1] eval(parse(t

Re: [R] Parallel processing random 'save' error

2013-07-01 Thread William Dunlap
> Error in checkForRemoteErrors(val) : > one node produced an error: (converted from warning) > 'D:\_pgf\quantile_analysis2_f13\_save\dbz084_nump48\bins' already exists That warning looks like it comes from dir.create(). Do you have code that looks like: if (!file.exists(tempDir)) { di

Re: [R] Add constraints to rbinom

2013-07-01 Thread Meyners, Michael
You don't need a constraint (rbinom won't give x>n), but you need to make sure you are using the n you want to use: try x <- cbind(x,rbinom(300,n[i],p[i]))# mind the "[i]" after the n at the respective line. Furthermore, you need to remove one transformation of x to make sure you divide by t

Re: [R] Gene expression clustering using several dependent samples

2013-07-01 Thread James C. Whanger
Hello Moritz, You may want to take a look at http://www.ncbi.nlm.nih.gov/pmc/articles/PMC3052263/ . DeSantis et al. (2009) identified different genomic profiles using a Bayesian Latent Class methodology. Best, James On Sun, Jun 30, 2013 at 2:47 PM, Moritz Kebschull wrote: > Dear list. > > I

Re: [R] Empty pdf

2013-07-01 Thread Adrian Trapletti
Thank you Adrian On 07/01/2013 03:04 PM, peter dalgaard wrote: On Jul 1, 2013, at 14:35 , Adrian Trapletti wrote: Dear all, I am comparing "R CMD BATCH script.R" with running the following code snippet within R: pdf("Rplots.pdf") source("script.R") dev.off() q(save="no") Among other things

Re: [R] Empty pdf

2013-07-01 Thread peter dalgaard
On Jul 1, 2013, at 14:35 , Adrian Trapletti wrote: > Dear all, > > I am comparing "R CMD BATCH script.R" with running the following code snippet > within R: > > pdf("Rplots.pdf") > source("script.R") > dev.off() > q(save="no") > > Among other things, one difference is that the former produces

[R] Empty pdf

2013-07-01 Thread Adrian Trapletti
Dear all, I am comparing "R CMD BATCH script.R" with running the following code snippet within R: pdf("Rplots.pdf") source("script.R") dev.off() q(save="no") Among other things, one difference is that the former produces no Rplots.pdf while the latter produces an empty Rplots.pdf, if script.

[R] Distance Measurement between probability distributions

2013-07-01 Thread Dzu
Dear R -Users, I wanted to know about some existing functions (despite of euclidiean) to compute the distance between multiple histograms. I have found some examples like "kullbakc -Leibler DIvergenz" but the syntax for this is not available? Does anybody have an idea? Thanks -- View this mess

Re: [R] Male and female signs as subscript in plot

2013-07-01 Thread Prof Brian Ripley
On 01/07/2013 09:03, David Winsemius wrote: On Jul 1, 2013, at 12:40 AM, Prof Brian Ripley wrote: On 01/07/2013 03:19, Emily Weiser wrote: Hello, I'd like to add labels to my plot that include a male or female symbol as subscript. I'm working in Windows Vista and R 3.0.0. I am able to add th

Re: [R] Lexical scoping is not what I expect

2013-07-01 Thread peter dalgaard
On Jun 30, 2013, at 14:35 , Duncan Murdoch wrote: > On 13-06-29 11:58 PM, Greg Snow wrote: >> If you want to write really confusing code it is possible to do: >> >> `1` <- 2 >> >> `1` + 1 >> >> and things like that, but it is probably a good idea not to. > > This is actually pretty simple, as

[R] Parallel processing random 'save' error

2013-07-01 Thread Rguy
Platform: Windows 7 Package: parallel Function: parLapply I am running a lengthy program with 8 parallel processes running in main memory. The processes save data using the 'save' function, to distinct files so that no conflicts writing to the same file are possible. I have been getting errors lik

Re: [R] Male and female signs as subscript in plot

2013-07-01 Thread David Winsemius
On Jul 1, 2013, at 12:40 AM, Prof Brian Ripley wrote: > On 01/07/2013 03:19, Emily Weiser wrote: >> Hello, >> >> I'd like to add labels to my plot that include a male or female symbol as >> subscript. >> I'm working in Windows Vista and R 3.0.0. >> I am able to add the male symbol to the plot as

Re: [R] Male and female signs as subscript in plot

2013-07-01 Thread Prof Brian Ripley
On 01/07/2013 03:19, Emily Weiser wrote: Hello, I'd like to add labels to my plot that include a male or female symbol as subscript. I'm working in Windows Vista and R 3.0.0. I am able to add the male symbol to the plot as regular text (NOT as subscript), e.g. with: mtext("Male\u2642") This disp

[R] Male and female signs as subscript in plot

2013-07-01 Thread Emily Weiser
Hello, I'd like to add labels to my plot that include a male or female symbol as subscript. I'm working in Windows Vista and R 3.0.0. I am able to add the male symbol to the plot as regular text (NOT as subscript), e.g. with: mtext("Male\u2642") This displays the word "Male" followed by the male s

[R] Gene expression clustering using several dependent samples

2013-07-01 Thread Moritz Kebschull
Dear list. I am looking at a dataset comprised of Affy images from disease-affected tissue samples that I am trying to cluster. The problem is that we have 2+ biopsies per study subject, and I am not sure how to best account for their dependency. In contrast to cancer samples, these biopsies diff