[R] How to label percentage values inside stacked bar plot using R-base

2013-02-18 Thread nay-nancy Laiser
Hello, I am new to R. I would like others to explain to me how to add absolute values inside the individual stacked bars in a consistent way using the basic R plotting function (R base). I tried to plot a stacked bar graph using R base but the values appear in an inconsistent/illogical way in such

[R] lattice dotplot labelling median and mean values for each panel

2013-02-18 Thread maxbre
By considering this reproducible example #start code library(lattice) dotplot(variety ~ yield | site, data = barley, layout = c(1,6), index.cond= function(x,y){median(x)}, panel = function(x,y,...) { panel.dotplot(x,y,...) median.values - median(x)

[R] RMSE comparison: test

2013-02-18 Thread ghjf fghjk
Hello, I did computation of the model like in the paper. And now I have RMSE from my estimated model and RMSE from the paper. The question is: How to do the test for two RMSEs? Thank you. [[alternative HTML version deleted]] __

Re: [R] Plot a Matrix as an Image with ggplot

2013-02-18 Thread Alaios
You are good! Many thanks Alex From: Dennis Murphy djmu...@gmail.com Cc: R help R-help@r-project.org Sent: Saturday, February 16, 2013 3:11 AM Subject: Re: [R] Plot a Matrix as an Image with ggplot Hi: See if the following works for you:

Re: [R] How to label percentage values inside stacked bar plot using R-base

2013-02-18 Thread Jim Lemon
On 02/18/2013 06:05 PM, nay-nancy Laiser wrote: Hello, I am new to R. I would like others to explain to me how to add absolute values inside the individual stacked bars in a consistent way using the basic R plotting function (R base). I tried to plot a stacked bar graph using R base but the

[R] repeated measures anova

2013-02-18 Thread Robert Douglas Kinley
Hi I'm having difficulty working out how to get what I think is the appropriate partitioning of variability in a repeated measures setup. I have G=5 treatment-groups, each containing n=6 subjects, and a response is measured on each subject on t=4 occasions. I think the anova degrees of

Re: [R] How to label percentage values inside stacked bar plot using R-base

2013-02-18 Thread Jim Lemon
On 02/18/2013 09:51 PM, Jim Lemon wrote: ... In fact, it is easier to label the bars like this: barlabels(xpos,mydata,cex=0.7) (I forgot that I had solved the stacked bar problem) Jim __ R-help@r-project.org mailing list

Re: [R] lattice dotplot labelling median and mean values for each panel

2013-02-18 Thread maxbre
sorry, I've managed to find a (partial) solution to my problem (even not much elegant); now what is left out is the proper tweaking of labels... any better solutions? dotplot(variety ~ yield | site, data = barley, layout = c(1,6), index.cond= function(x,y){median(x)},

Re: [R] lattice dotplot labelling median and mean values for each panel

2013-02-18 Thread maxbre
sorry again, there is something more to consider... in case I need to plot x axis in logarithmic scale the above solution is not working: so now my further question is how to do that when I set scales=list(x=list(log=TRUE)) I've been trying to simplify my original example to the bare bone (for

Re: [R] How to do a backward calculation for each record in a dataset

2013-02-18 Thread Prakasit Singkateera
Hi all, Firstly, it is not a homework. I am working for a hotel booking company in Thailand but I don't want to explain a complex equation and concept here so I keep it simple and closely related to what I am trying to solve.I apology if my question is not clear enough. I am new to R and

[R] Generating QFs from same sample

2013-02-18 Thread M. Rauf Ahmad
Dear All I am kind of stuck up with a code a part of which seems to be causing a problem, or at least I think so. May be the community can help me. It’s simple but I suppose I am missing something. I generate a data matrix X, say of order n*p, where n represents independent row-vectors and p

[R] repeated measures anova

2013-02-18 Thread Robert D Kinley
Hi I'm having difficulty working out how to get what I think is the appropriate partitioning of variability in a repeated measures setup. I have G=5 treatment-groups, each containing n=6 subjects, and a response is measured on each subject on t=4 occasions. I think the anova degrees of

[R] ggplot2 and facet_wrap help

2013-02-18 Thread francesca casalino
Dear R experts, I am trying to arrange multiple plots, creating one graph for each size1 factor variable in my data frame, and each plot has the median price on the y-axis and the size2 on the x-axis grouped by clarity: library(ggplot2) df - data.frame(price=matrix(sample(1:1000, 100, replace =

[R] FW: Best R package for Finite Mixture Models or Latent Class Models

2013-02-18 Thread R Project
Can anyone point me to a comparision of the various packages avaliable to do Finite Mixture Models or Latent Class Models in R. As ever my googling only produce papers on specific packages or implementations. I am looking of a considered comparision that criticlaly compares them.

[R] foreach loop, stata equivalent

2013-02-18 Thread Jamora, Nelissa
Hi! I'm a recent convert from Stata, so forgive my ignorance. In Stata, I can write foreach loops (example below) foreach var of varlist p1-p14 { foreach y of varlist p15-p269 { reg `var' `y' } } It's looping p1-p15, p1-p16, p1-p269, p2-p15, p2-p16,... p2-p269,... variable

[R] foreach loop, stata equivalent

2013-02-18 Thread Jamora, Nelissa
Hi! I'm a recent convert from Stata, so forgive my ignorance. In Stata, I can write foreach loops (example below) foreach var of varlist p1-p14 { foreach y of varlist p15-p269 { reg `var' `y' } } It's looping p1-p15, p1-p16, p1-p269, p2-p15, p2-p16,... p2-p269,... variable

Re: [R] How to do a backward calculation for each record in a dataset

2013-02-18 Thread Berend Hasselman
On 18-02-2013, at 10:34, Prakasit Singkateera asltjoey.rs...@gmail.com wrote: Hi all, Firstly, it is not a homework. I am working for a hotel booking company in Thailand but I don't want to explain a complex equation and concept here so I keep it simple and closely related to what I am

Re: [R] ggplot2 and facet_wrap help

2013-02-18 Thread Ista Zahn
Hi, You are making it more complicated than it needs to be. You already provided the data.frame in the ggplot call, so you don't need to specify it in the aes calls. The various factor() and as.factor() calls are also unnecessary. So stripping away this extra stuff your plot looks like

[R] odfWeave: Trouble Getting the Package to Work

2013-02-18 Thread Paul Miller
Hello All, Have recently started learning Sweave and Knitr. Am now trying to learn odfWeave as well. Things went pretty smoothly with Sweave and Knitr but I'm having some trouble with odfWeave. My understanding was that odfWeave should work in pretty much the same way as Sweave. With

Re: [R] Random number generator used in 'runif'

2013-02-18 Thread S Ellison
On the same help page, it says 'RNGkind' is a more friendly interface to query or set the kind of RNG in use. Try RNGkind() to see the currently selected RNG. The same function with kind= specified will also change to another S Ellison -Original Message- From:

[R] mtext unicode failure

2013-02-18 Thread e-letter
Readers, How to solve this unicode input error please? postscript(~/tmp/test.eps,width=100/25.4,height=100/25.4,horizontal=FALSE,onefile=TRUE,paper=special) testx-seq(1:5) testy-seq(1:5) plot(testy~testx) mtext('text (O₂)\n more text',side=3,line=1) Warning messages: 1: In mtext(text (O₂)\n

[R] attempt to apply non-function

2013-02-18 Thread Jannetta Steyn
Hi All I am getting the above mentioned error when I run the code below. I don't know why because I have implemented the function and I'm calling the function with a parameter. I'm obviously missing the plot ... Can someone perhaps point out the error of my ways? Error: out-ode(y=init,

Re: [R] repeated measures anova

2013-02-18 Thread Bert Gunter
1. Please do not multiple post. 2. One approach would be mixed effects models. See the nlme and lme4 packages. 3. But there are a host of others (including, perhaps, just ?aov.). 4. This is a statistical question, and off topic here. Post on the r-sig-mixed-effects models list instead or s

Re: [R] RMSE comparison: test

2013-02-18 Thread Nnina
Hello, I did computation of the model like in the paper. And now I have RMSE from my estimated model and RMSE from the paper. The question is: How to do the test for two RMSEs? Thank you. 2013/2/18 ghjf fghjk lgnina...@gmail.com Hello, I did computation of the model like in the paper. And

Re: [R] foreach loop, stata equivalent

2013-02-18 Thread Milan Bouchet-Valat
Le lundi 18 février 2013 à 13:48 +0100, Jamora, Nelissa a écrit : Hi! I'm a recent convert from Stata, so forgive my ignorance. In Stata, I can write foreach loops (example below) foreach var of varlist p1-p14 { foreach y of varlist p15-p269 { reg `var' `y' } }

Re: [R] odfWeave: Trouble Getting the Package to Work

2013-02-18 Thread Max Kuhn
That's not a reproducible example. There is no sessionInfo() and you omitted code (where did 'fp' come from?). It works fine for me (see sessionInfo below) using the code in ?odfWeave. As for the file paths: you can point to different paths for the files (although don't change the working

Re: [R] mtext unicode failure

2013-02-18 Thread Prof Brian Ripley
On 18/02/2013 14:15, e-letter wrote: Readers, How to solve this unicode input error please? On what system, in what locale? And where is Unicode mentioned? If you intended a subscript 2, use plotmath. That is not a character in the standard Postscript fonts, nor is in the encoding you

Re: [R] attempt to apply non-function

2013-02-18 Thread Berend Hasselman
On 18-02-2013, at 15:19, Jannetta Steyn janne...@henning.org wrote: Hi All I am getting the above mentioned error when I run the code below. I don't know why because I have implemented the function and I'm calling the function with a parameter. I'm obviously missing the plot ... Can

[R] RMSE comparison: test

2013-02-18 Thread Nnina
Hello, I did computation of the model like in the paper. And now I have RMSE from my estimated model and RMSE from the paper. The question is: How to do the test for two RMSEs? e.g. like Null hypothesis: RMSE1-RMSE2=0 I have the paper and I am doing computation exactly like it is described in

[R] continuous shading in plots

2013-02-18 Thread Elisabeth wever
Hi, Can someone help me with the following? I currently have the following plot: plot(c(0,14,0,14),c(0,5,0,5),ann = FALSE, xaxs=i, yaxs=i,bty=L ) polygon(c(0,18,18), c(0,6,0), col='light grey', border = NA) polygon(c(0,18,18), c(0,2,0), col='grey', border = NA) However, I would like to make

[R] [R-pkgs] Version 1.0 of MVN package on CRAN‏

2013-02-18 Thread Selçuk Korkmaz
Dear colleagues, This is to inform you that Version 1.0 of the R package MVN has been released on CRAN yesterday. This package contain several multivariate normality tests such as Henze-Zirkler, Mardia and Royston. HZ.test: The Henze-Zirkler (HZ) test is based on a non-negative functional

Re: [R] foreach loop, stata equivalent

2013-02-18 Thread Jamora, Nelissa
Hi Milan, Thanks for responding to my question. I'm actually not interested in LM, it was more for example. You are right, I'm trying an enormous set of model runs. My Var1 n=14; Var2 n=255 == 3570! But first, I need be able to set up 2 variables in each model run. Those 2 variables are

[R] help with population matrix

2013-02-18 Thread Sam Fowler
Hi guys, I am a biologist and an R newbie, and I'm learning how to create a simple population model. So, I have a population matrix (pop)of 30 age classes of female (1:4 are non-breeders, 5:30 are breeders) which will be modelled for 100 years. pop - matrix(0,30,100) I then populate this

[R] Calculating seasonal anomalies

2013-02-18 Thread Hefri
I have an irregular time series, which cannot easily be converted to a ts object (long stretches with NA). I have calculated the climatological mean and st.dev, but need help on how to calculate the anomalies from the climatology and my original data set. Below is an example, where I have

Re: [R] ggplot2 and facet_wrap help

2013-02-18 Thread francesca casalino
Dear Ista, Thank you! It works perfectly! -fra 2013/2/18 Ista Zahn istaz...@gmail.com: Hi, You are making it more complicated than it needs to be. You already provided the data.frame in the ggplot call, so you don't need to specify it in the aes calls. The various factor() and as.factor()

Re: [R] nested random factor using lme produces errors

2013-02-18 Thread Ben Bolker
melswed amelie.truchy at slu.se writes: I understand. I want to specify that drug is only a fixed factor and family should be the only random factor. So maybe, my R code is wrong If I specify random=~1|drug/family it is only because I wanted to specify that family is nested within drug.

Re: [R] foreach loop, stata equivalent

2013-02-18 Thread Milan Bouchet-Valat
Le lundi 18 février 2013 à 17:09 +0100, Jamora, Nelissa a écrit : Hi Milan, Thanks for responding to my question. I'm actually not interested in LM, it was more for example. You are right, I'm trying an enormous set of model runs. My Var1 n=14; Var2 n=255 == 3570! But first, I need

Re: [R] odfWeave: Trouble Getting the Package to Work

2013-02-18 Thread Paul Miller
Hi Max,   Sorry I didn't provide sufficient information. Below is my sessionInfo with all code included.   Thanks,   Paul   sessionInfo() R version 2.13.1 (2011-07-08) Platform: x86_64-pc-mingw32/x64 (64-bit) locale: [1] LC_COLLATE=English_United States.1252 [2] LC_CTYPE=English_United

Re: [R] help with population matrix

2013-02-18 Thread John Kane
Currently your code does not seem to make any sense ===comments in line John Kane Kingston ON Canada -Original Message- From: s...@st-andrews.ac.uk Sent: Mon, 18 Feb 2013 16:09:49 + To: r-help@r-project.org Subject: [R] help with population matrix Hi guys, I am a

Re: [R] foreach loop, stata equivalent

2013-02-18 Thread Joshua Wiley
If you have the same set of predictors for multiple outcomes, you can speed up the process considerably by taking advantage of the fact that the design matrix is the same for multiple outcomes. As an example: set.seed(10) y - matrix(rnorm(1 * 14), ncol = 14) x - matrix(rnorm(1 * 2), ncol

Re: [R] RMSE comparison: test

2013-02-18 Thread Jeff Newmiller
Please don't repeat yourself. Please read the Posting Guide. Don't post here using HTML email. This is a statistics question, not an R question, so it is off topic here. --- Jeff NewmillerThe

Re: [R] help with population matrix

2013-02-18 Thread Roy Mendelssohn - NOAA Federal
See if this helps at all: http://cran.r-project.org/web/packages/popbio/popbio.pdf -Roy M. On Feb 18, 2013, at 8:49 AM, John Kane jrkrid...@inbox.com wrote: Currently your code does not seem to make any sense ===comments in line John Kane Kingston ON Canada -Original

Re: [R] Calculating seasonal anomalies

2013-02-18 Thread Rui Barradas
Hello, Try the following. Month - format(Dat$open_date, %m) anom - Dat$Dry_w - ave(Dat$Dry_w, Month, FUN = function(x) mean(x, na.rm = TRUE)) st.anom - Dat$PP_int - ave(Dat$PP_int, Month, FUN = function(x) mean(x, na.rm = TRUE)) Hope this helps, Rui Barradas Em 18-02-2013 14:03, Hefri

Re: [R] help with population matrix

2013-02-18 Thread David L Carlson
It will be better if you can give us a complete example of what you want to do. You start off with a typo in your for() command using y but then switching to t in the code. You also say the rows all have different survival probabilities but it is not clear where that fits into the picture (b/2,

[R] lattice 3x3 plot: force common y-limits accross rows and align x-axes

2013-02-18 Thread Boris Vasiliev
Hi Duncan, Thank you for quick reply. I am not sure that your solution solves the problem. If I use useOuterStrips(dotplot(count ~ subject|risk*treatment,df)) the order of subjects and panel y-limits in each panel are A, B, BB, CCC, DD, . However, the order of subjects and y-limits

[R] Uplift modeling with R ?

2013-02-18 Thread Franck . BERTHUIT
Hello R'users, I've tried to find a package or some code about Uplift modeling within R (or Netlift modeling, Incremental or Differential response modeling) but failed.  If you have any clue of source about Uplift modeling with R on the web, i would appreciate to share it with you. Thank's

Re: [R] lattice 3x3 plot: force common y-limits accross rows and align x-axes

2013-02-18 Thread Bert Gunter
Boris: If I understand you correctly, you wish to set panel limits by row. I know of no slick way of doing this (others may), as what is in a row can change depending on layout and how you determine the scale for the rows' contents may depend on the application context. So I would do it

Re: [R] Uplift modeling with R ?

2013-02-18 Thread Bert Gunter
Search! Google on uplift modeling in R or similar. I got: http://blog.data-miners.com/2009/12/differential-response-or-uplift.html There is undoubtedly more. -- Bert On Mon, Feb 18, 2013 at 9:38 AM, franck.berth...@maif.fr wrote: Hello R'users, I've tried to find a package or some code

Re: [R] reading data

2013-02-18 Thread arun
Hi Vera, Not sure I understand your question. Your statement In my lista I can´t merge rows to have the group, because the idea is for each file count  frequencies of mm, when b0.01. after that I want a graph like the graph in attach.  files-paste(MSMS_,23,PepInfo.txt,sep=)

Re: [R] Cox model convergence

2013-02-18 Thread Terry Therneau
On 02/16/2013 05:00 AM, r-help-requ...@r-project.org wrote: Then I perform cox regression as follows m2_1-coxph(Surv(X_t0,X_t, vlsupp) ~ nvp + as.factor(cd4pccat) + as.factor(vlcat) + as.factor(agecat) + as.factor(whostage) + as.factor(hfacat) + as.factor(wfacat) + as.factor(wfhcat) +

Re: [R] reading data

2013-02-18 Thread arun
Hi, I am not able to open your graph.  I am using linux. Also, the codes in the function are not reproducible  directT - direct[grepl(^t, direct)]  directC - direct[grepl(^c, direct)] It takes double the time to know what is going on. dir() #[1] a1 a2 a3 b1 b2 c1 direct-

Re: [R] How to do a backward calculation for each record in a dataset

2013-02-18 Thread Rolf Turner
Some (quite a few!) years ago I wrote myself a wee function called compInt() (compound interest) to do --- I think --- just what you require. I have attached the code for this function and a help file for it. If anyone else wants this code, and if the attachments don't get through the list,

Re: [R] Random number generator used in 'runif'

2013-02-18 Thread Daniel Nordlund
-Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Mauricio Zambrano-Bigiarini Sent: Monday, February 18, 2013 1:33 AM To: r-help@r-project.org Subject: [R] Random number generator used in 'runif' Dear list, For the

Re: [R] How to do a backward calculation for each record in a dataset

2013-02-18 Thread Berend Hasselman
Rolf, Your attachments got through. But where is the function newt(…) Berend On 18-02-2013, at 21:25, Rolf Turner rolf.tur...@xtra.co.nz wrote: Some (quite a few!) years ago I wrote myself a wee function called compInt() (compound interest) to do --- I think --- just what you require. I

[R] How to title the excel chart and axis using RDCOMClient

2013-02-18 Thread anil upadrasta
Hello,   I'm trying to create an Excel chart using the package RDCOMClient. I am not able to title the excel chart and axis using RDCOMClient  ChartTitle and Axis?   Any suggestions or references is appreciated.   Thanks, uak. [[alternative HTML version deleted]]

[R] How to calculate the moving average for binary files?

2013-02-18 Thread Jonsson
I have 12 binary (raster) files https://echange-fichiers.inra.fr/get?k=k3M2jatJyHy65Cs99G4 . I would like to calculate the moving average for the 12 values for each pixel in the 12 files. For a simple vector we can get a moving average by using this : x -

Re: [R] doubt with function on R software

2013-02-18 Thread Pete Brecknock
monicamir88 wrote Hello! I have a doubt with the R software. I have this function: results - function(bCODBOD, BOD, VSS, COD, sBOD, sCOD, TSS, TKNpa, T, NH3Ne, DO, Q, TKN, MLSS, NO3Ne, RAS, tanoxic1, tanoxic2, rbCOD, SDNR1, SDNR2, tdanoxic, tanaerobic, IRp, P) { bCOD - bCODBOD*BOD nbCOD -

Re: [R] How to calculate the moving average for binary files?

2013-02-18 Thread David Winsemius
On Feb 18, 2013, at 12:28 PM, Jonsson wrote: I have 12 binary (raster) files https://echange-fichiers.inra.fr/get?k=k3M2jatJyHy65Cs99G4 . I would like to calculate the moving average for the 12 values for each pixel in the 12 files. For a simple vector we can get a moving average by

[R] error: Error in if (is.na(f0$objective)) { : argument is of length zero

2013-02-18 Thread Aya Anas
Dear all, I tried running the following syntax but it keeps running for about 4 hours and then i got the following errors: Error in if (is.na(f0$objective)) { : argument is of length zero In addition: Warning message: In is.na(f0$objective) : is.na() applied to non-(list or vector) of type

Re: [R] error: Error in if (is.na(f0$objective)) { : argument is of length zero

2013-02-18 Thread Bert Gunter
You're kidding, right?! See ?traceback for browsing the call stack after an error. Also ?browser, ?debug, and ?recover for other debugging options. -- Bert On Mon, Feb 18, 2013 at 1:28 PM, Aya Anas aa...@feps.edu.eg wrote: Dear all, I tried running the following syntax but it keeps running

Re: [R] error: Error in if (is.na(f0$objective)) { : argument is of length zero

2013-02-18 Thread jim holtman
Following up on what Bert said, also put options(error=utils::recover) at the start of the script so that on errors you get the traceback printed out and the you can also use the browser to look at the values of the objects at the point of the error. This is debugging 101. On Mon, Feb 18, 2013

Re: [R] addition in the initial question [SCL:4]

2013-02-18 Thread arun
Hi Elisa, I think your question is regarding why the third column (Frequency) is absent?? aggregate(row.names(dat1)~class,dat1,function(x) x)[1]  #Here, the first two class are not there, because it was not in the dataset. (0.1x=0.2) was not there and (0x=0.1) is also not present, eventhough 0

Re: [R] continuous shading in plots

2013-02-18 Thread Jim Lemon
On 02/19/2013 01:20 AM, Elisabeth wever wrote: Hi, Can someone help me with the following? I currently have the following plot: plot(c(0,14,0,14),c(0,5,0,5),ann = FALSE, xaxs=i, yaxs=i,bty=L ) polygon(c(0,18,18), c(0,6,0), col='light grey', border = NA) polygon(c(0,18,18), c(0,2,0),

Re: [R] R function help!

2013-02-18 Thread Pete Brecknock
simonj16 wrote Consider an urn that contains 10 tickets, labelled: 1,1,1,1,2,5,5,10,10,10 I want to draw with replacement n=40 tickets. I am interested in the sum, Y, of the 40 ticket values that I draw Write an R function named urn.model that simulates this experiement. What I have below

Re: [R] continuous shading in plots

2013-02-18 Thread Jim Lemon
On 02/19/2013 09:50 AM, Jim Lemon wrote: Hi Elisabeth, For a quick hack, try this: segments(rep(0,100),seq(-4.5,0,length.out=200),rep(14,200), seq(0,4.5,length.out=200), col=rgb(seq(0.8,0.5,length.out=200),seq(0.8,0.5,length.out=200), seq(0.8,0.5,length.out=200)),lwd=2) and even easier:

Re: [R] continuous shading in plots

2013-02-18 Thread Rui Barradas
Hello, Or with base R only, smooth - colorRampPalette(c('white', 'darkgrey')) segments(rep(0,100),seq(-4.5,0,length.out=200),rep(14,200), seq(0,4.5,length.out=200), col = smooth(200), lwd = 2) Hope this helps, Rui Barradas Em 18-02-2013 23:30, Jim Lemon escreveu: On 02/19/2013 09:50 AM,

Re: [R] odfWeave: Trouble Getting the Package to Work

2013-02-18 Thread mxkuhn
What version of odfWeave and XML? On Feb 18, 2013, at 11:49 AM, Paul Miller pjmiller...@yahoo.com wrote: Hi Max, Sorry I didn't provide sufficient information. Below is my sessionInfo with all code included. Thanks, Paul sessionInfo() R version 2.13.1 (2011-07-08) Platform:

[R] creating a new variable.

2013-02-18 Thread Nicole Ford
hello, all. in my previous research, i have always used existing data. i am trying something new as an exploratory exercise and have never create my own variable form scratch. essentially, i am creating a variable for party affiliation. here is an example. var =party. levels= democrat,

[R] Are there multivariate GARCH packages in R?

2013-02-18 Thread jpm miao
Hi , Are there any multivariate GARCH package (e.g., BEKK) in R? I do see a few projects constructing multivariate GARCH package, but wonder if there is anyone that is ready for use. Thanks, Miao [[alternative HTML version deleted]]

Re: [R] Are there multivariate GARCH packages in R?

2013-02-18 Thread David Winsemius
On Feb 18, 2013, at 5:16 PM, jpm miao wrote: Hi , Are there any multivariate GARCH package (e.g., BEKK) in R? I do see a few projects constructing multivariate GARCH package, but wonder if there is anyone that is ready for use. What efforts have you made at searching? In particular

Re: [R] creating a new variable.

2013-02-18 Thread Ista Zahn
Hi Nicole, On Mon, Feb 18, 2013 at 7:01 PM, Nicole Ford nicole.f...@me.com wrote: hello, all. in my previous research, i have always used existing data. i am trying something new as an exploratory exercise and have never create my own variable form scratch. essentially, i am creating a

Re: [R] How to do a backward calculation for each record in a dataset

2013-02-18 Thread Rolf Turner
On 02/19/2013 09:44 AM, Berend Hasselman wrote: Rolf, Your attachments got through. But where is the function newt(…)? A --- dang! It's another item from my personal miscellany package which I'm so used to having around that I forgot that other people don't have it. Attached. Along

Re: [R] creating a new variable.

2013-02-18 Thread Jim Lemon
On 02/19/2013 11:01 AM, Nicole Ford wrote: hello, all. in my previous research, i have always used existing data. i am trying something new as an exploratory exercise and have never create my own variable form scratch. essentially, i am creating a variable for party affiliation. here is an

Re: [R] lattice 3x3 plot: force common y-limits accross rows and align x-axes

2013-02-18 Thread Boris Vasiliev
Bert, Thank you very much for your reply.  Your suggestions to set manually y-limits of panels in lattice plot certainly puts me on the right track. It works really well with xyplot(): hf - data.frame(    x=seq(1,20,by=1),    y=seq(0.1,2,by=0.1),    risk=gl(2,10,labels=c(low,high)),   

Re: [R] R function help!

2013-02-18 Thread Rolf Turner
Pete: Please don't do people's homework for them! At most, give them a ***hint*** only. cheers, Rolf Turner On 02/19/2013 12:01 PM, Pete Brecknock wrote: simonj16 wrote Consider an urn that contains 10 tickets, labelled: 1,1,1,1,2,5,5,10,10,10 I want to draw with replacement

[R] how to change the plot from X-axis to Y-axis

2013-02-18 Thread Jie Tang
hello ,Rusers: I have a dataset for example totdata=c(8.020 7.412 8.110 8.270) plot(totdata[1:4],type='l',pch=1,lty=1,col='blue',lwd=1) and the data could be plotted as the attachment figure. now I want to exchange its x-axis and y-axis in the figure .How could I modify the plot command ?

Re: [R] lattice 3x3 plot: force common y-limits accross rows and align x-axes

2013-02-18 Thread Duncan Mackay
Hi Boris Just a different take on it, quick glimpse of it library(lattice) library(latticeExtra) z= unique(df$subject) df$nsub - sapply(df$subject, pmatch, z) useOuterStrips(xyplot(count ~ nsub|treatment*risk, df, type = h, lwd = 2, scales = list(x = list(at = 1:6, labels = z The

Re: [R] how to change the plot from X-axis to Y-axis

2013-02-18 Thread Jim Lemon
On 02/19/2013 02:17 PM, Jie Tang wrote: hello ,Rusers: I have a dataset for example totdata=c(8.020 7.412 8.110 8.270) plot(totdata[1:4],type='l',pch=1,lty=1,col='blue',lwd=1) and the data could be plotted as the attachment figure. now I want to exchange its x-axis and y-axis in the figure

Re: [R] how to change the plot from X-axis to Y-axis

2013-02-18 Thread arun
Hi  plot(totdata,seq_along(totdata),type='l',pch=1,lty=1,col='blue',lwd=1) A.K. - Original Message - From: Jie Tang totang...@gmail.com To: r-help@r-project.org Cc: Sent: Monday, February 18, 2013 10:17 PM Subject: [R] how to change the plot from X-axis to Y-axis hello ,Rusers: I

[R] R nls results different from those of Excel ??

2013-02-18 Thread David Gwenzi
Hi all I have a set of data whose scatter plot shows a very nice power relationship. My problem is when I fit a Power Trend Line in an Excel spreadsheet, I get the model y= 44.23x^2.06 with an R square value of 0.72. Now, if I input the same data into R and use model -nls(y~ a*x^b , trace=TRUE,

Re: [R] cumulative sum by group and under some criteria

2013-02-18 Thread Zjoanna
Thanks. I tried this code below, why does expanded dataset 'res1' has m1=3 and n1=3 , dataset 'd3' doesn't have m1=3, n1=3. d3-structure(list(m1 = c(2, 3, 2), n1 = c(2, 2, 3), cterm1_P0L = c(0.9025, 0.857375, 0.9025), cterm1_P1L = c(0.64, 0.512, 0.64), cterm1_P0H = c(0.9025, 0.9025, 0.857375),

Re: [R] R nls results different from those of Excel ??

2013-02-18 Thread Greg Snow
Have you plotted the data and the lines to see how they compare? (see fortune(193)). Is there error around the line in the data? The nls function is known to not work well when there is no error around the line. Also check and make sure that the 2 methods are fitting the same model. You

Re: [R] R nls results different from those of Excel ??

2013-02-18 Thread Rolf Turner
To paraphrase Bill Venables (see fortune(217)): Simple. Excel must be broken. Have you reported it to them? (The difference in this case is that it is probable that Excel *is* broken. It usually is.) cheers, Rolf Turner On 02/19/2013 05:49 PM, David Gwenzi wrote: Hi all

Re: [R] R nls results different from those of Excel ??

2013-02-18 Thread Jeff Newmiller
Excel definitely does not use nonlinear least squares fitting for power curve fitting. It uses linear LS fitting of the logs of x and y. There should be no surprise in the OP's observation. --- Jeff Newmiller

Re: [R] How to do a backward calculation for each record in a dataset

2013-02-18 Thread Prakasit Singkateera
Hi Berend, Thank you for your information. However, I am still not clear on the Rpmt function please elaborate more about - What is the purpose of Rpmt function? Why do you subtract pmt(xrate,x,xpv) from xpmt? / What is the meaning of xpmt ? - And what is the purpose of doing