[R] overlap histogram and density

2010-11-11 Thread Roslina Zakaria
Hi, Does anybody encounter the same problem when we overlap histogram and density     that the density line seem to shift to the right a little bit?           If you do have the same problem, what should we do to correct that?           Thank you.           par(mar=c(4,4,2,1.2),oma=c(0,0,0,0))  

[R] solve nonlinear equation using BBsolve

2010-11-20 Thread Roslina Zakaria
Hi r-users, I would like to solve system of nonlinear equation using BBsolve function and below is my code.  I have 4 parameters and I have 4 eqns. mgf_gammasum - function(p) { t  - rep(NA, length(p)) mn - 142.36 vr - 9335.69 sk - 0.8139635 kur - 3.252591 rh  - 0.896 # cumulants k1 -

[R] need smooth cdf lines

2010-11-21 Thread Roslina Zakaria
Hi, I would like to overlap the cdf curve for observed and generated data  Here is my code: plot(cdf,main =CDF of the sum for winter season-Hume,cex.axis=1.2,xlab=Rainfall (mm), xaxs=i,yaxs=i,col=c(black,red), lty=c(1,1),ylab=Cumulative probability, xlim=c(0,800),lwd=1) lines(ecdf(datobs))

[R] plot start at origin

2010-11-21 Thread Roslina Zakaria
Hi r-users, I would like my axes to intersect at (0,0).  I tried  xaxs=i,yaxs=i but it does not change anything.  I hope anybody can help me with this problem.  Here is my code. hist(datobs, prob=TRUE, main =PDF of the sum of two stations,col=yellowgreen, cex.axis=1.2, xlab=Rainfall (mm),

[R] overlap cdf plots and add colors and etc

2010-11-24 Thread Roslina Zakaria
Hi r-users, I would like to overlap 2 ecdf plots.  I tried this below and it gives me two plots of ecdf but just both just in black. par(mar=c(4,4,2,1.2),oma=c(0,0,0,0),xaxs=i, yaxs=i) plot(ecdf(datobs)) lines(ecdf(gam_sum_gen)) Then I try to add colors etc and also the legend but fail.

Re: [R] overlap cdf plots and add colors and etc

2010-11-24 Thread Roslina Zakaria
, Try par(mar=c(4,4,2,1.2),oma=c(0,0,0,0),xaxs=i, yaxs=i) plot(ecdf(rnorm(100))) plot(ecdf(rnorm(100)), add = TRUE, col = 2) HTH, Jorge On Thu, Nov 25, 2010 at 12:18 AM, Roslina Zakaria wrote: Hi r-users, I would like to overlap 2 ecdf plots.  I tried this below and it gives me two plots

Re: [R] overlap cdf plots and add colors and etc

2010-11-25 Thread Roslina Zakaria
...@gmail.com; r-help@r-project.org r-help@r-project.org Sent: Fri, November 26, 2010 12:52:56 AM Subject: Re: [R] overlap cdf plots and add colors and etc On 2010-11-24 22:24, Roslina Zakaria wrote: Hi Jorge, I tried but still it does not work.  Thank you for your time. Jorge's code works

Re: [R] overlap histogram and density

2010-11-25 Thread Roslina Zakaria
Subject: Re: [R] overlap histogram and density [OOPS!!I accidentally reproduced my second example below as my third example. Now corrected. See below.] On 11-Nov-10 20:02:29, Ted Harding wrote: On 11-Nov-10 18:39:34, Roslina Zakaria wrote: Hi, Does anybody encounter the same problem when we

[R] anderson-darling test

2010-07-27 Thread Roslina Zakaria
Hi, I have the binned data (observed and generated from model)  that I would like to test using the anderson-darling goodness of fit test.  But I'm not sure which package in R to use. I tried ad.test(...) but it does not recognise the test by Vito Ricci in FITTING DISTRIBUTIONS WITH R  

[R] barplot and x-axis font size

2010-08-04 Thread Roslina Zakaria
Hi all, I would like to draw a side by side bar plot.  How can I adjust the the font size for the x-axis?  Furthermore, I'm not sure what to write for 'at=?'.  I tried cex.axis and cex.lab but still fail.  Here is my data and code:   t(all)    0-100 100-150  150-200 200-250 250-300

[R] Kolmogorov-Smirnov test, which one to use?

2010-08-04 Thread Roslina Zakaria
Hi, I have two sets of data, an observed data and generated data. The generated data is obtained from the model where the parameters is estimated from the observed data. So I'm not sure which to use either one-sample test ks.test(x+2, pgamma, 3, 2) # two-sided, exact or two-sample test

[R] which one give clear picture-pdf, jpg or tiff?

2010-08-19 Thread Roslina Zakaria
Hi, I need some opinion.  I would like to use graph that I generate from R code and save it into word document.  Which format is better? pdf, jpeg or tiff? Thank you. [[alternative HTML version deleted]] __ R-help@r-project.org

[R] extract month data automatically

2010-09-02 Thread Roslina Zakaria
Hi, I would like to extract monthly data automatically using a code.  Given are my sample data. I know how to do one by one: jan_data1 - Pooraka_data[Pooraka_data$Month==1,4] feb_data1 - Pooraka_data[Pooraka_data$Month==2,4] mar_data1 - Pooraka_data[Pooraka_data$Month==3,4] apr_data1 -

[R] Kolmogorov smirnov test

2009-10-12 Thread Roslina Zakaria
Hi r-users,   I would like to use Kolmogorov smirnov test but in my observed data(xobs) there are ties.  I got the warning message.  My question is can I do something about it?   ks.test(xobs, xsyn)       Two-sample Kolmogorov-Smirnov test data:  xobs and xsyn D = 0.0502, p-value = 0.924

[R] BB package

2010-04-28 Thread Roslina Zakaria
Hi I would like to solve a system of nonlinear equations below using dfsane function   mn - 142.36; vr - 9335.69 ; sk - 0.81;  kur - 0.25 test_fn - function(p) {    f - rep(NA, length(p))     f[1] - p[1]*(p [2]+p[3])- mn   f[2] - - vr + 2*p[1]*p[2]*p[3]*(p[4]-1)+p[1]*(p[2]+p[3])^2   f[3] - -

[R] smooth line overlap with histogram

2010-05-06 Thread Roslina Zakaria
Hi r-users,   I would like to overlap a smooth line on the histogram.  I tried using spline but it does not work. sq - seq(0,900,by=50) sq.50  - as.character(sq) datobs - sum_pos ## first, plot histogram histo - hist(datobs,breaks=sq,freq=F) ## extract counts from histogram and calculate

[R] kernel density to smooth plots

2010-05-10 Thread Roslina Zakaria
Hi r-sers, I have a data of relative frequencies for the interval of 0-20, 20-40,...380-400.  I would like the two data on the same graph using the same x-axis label.  My question is how to get a smooth curve using kernel density code if it possible for this data.   cbind(rel_obs,rel_gen)

[R] sapply code

2010-05-16 Thread Roslina Zakaria
Hi r-users,   I have this code here, but I just wonder how do I use 'sapply' to make it more efficient lamda_cor - eigen(winter_cor)$values   lamda_cor [1] 1.3459066 1.0368399 0.8958128 0.7214407   lamda_cxn - function(dt) { n   - length(dt)   term    - vector(length=n, mode=numeric)    

[R] sum of certain length

2010-05-23 Thread Roslina Zakaria
Hi r-users,   I have this data below.  I would like to obtain the weekly rainfall sum.  That is I would like to find sum for day 1 to day 7, day 8 - day15, and so on.    year month day rain 1  1922 1   1  0.0 2  1922 1   2  0.0 3  1922 1   3  0.0 4  1922 1   4  0.0 5  1922 1  

[R] Titles in plots overlap

2009-11-24 Thread Roslina Zakaria
Hi,   I use fCopulae package to draw different graphs of univariate and bivariate skew t.  But the plots titles overlap.  I tried using cex.main, font.main to adjust the size but they still overlaps.  Here is my code: par(mfrow = c(3, 1)) mu = 0 Omega = 1 alpha1 = 0 alpha2 = 1.5 alpha3 = 2

[R] draw a box at 10% lower and upper in scatter plot

2009-12-01 Thread Roslina Zakaria
Hi,   I would like to draw a box at each corner of lower 10% and upper 10% in the scatter plot on(0,1)*(0,1)  to indicate the lower and upper tail.  I hope somebody can help me.   Here is my code: ## scatter plot plot(hume_uni[,2],beec_uni[,2], pch=19, xlab=Hume_uni, ylab=Beec_uni, col= blue) 

[R] change the scale of grid lines in a plot

2009-12-16 Thread Roslina Zakaria
Hi,   I would like to change a scale of the grid lines in a plot.  I can see the default is 0.2, so how do I change to 0.1?   Thank you so much for any help given. [[alternative HTML version deleted]] __ R-help@r-project.org mailing

[R] test of proportions

2009-12-29 Thread Roslina Zakaria
Hi r-users,   I would like to use prop.test code and I also calculate manually to test the proportions for 2 groups.  The problem is the answer for the p-value calculated manually are different from prop.test.  Here are the results:   ## Manually   z value: z= (phat-p)/sqrt(pq/n) =

[R] decimal value for p-value

2010-01-06 Thread Roslina Zakaria
Dear r-users,   I conducted a chi-square test using chi.test code and found that my p-value = 1.  My question is, is it possible to get the decimals form of the p-value?  Maybe the p-value is actually 0. before rounding the value.   thank you so much for any help given.  

[R] something like vlookup in R?

2010-05-27 Thread Roslina Zakaria
Hi r users,   I would like sort of   cdf         seq   rand 0.00E+00    0 0.262123478 1.56E-03    20    0.964293344 1.55E-02    40    0.494827113 5.30E-02    60    0.733726005 1.16E-01    80    0.800408948 1.97E-01    100   0.925748466 2.88E-01    120   0.047578356 3.80E-01    140  

[R] vlookup in R?

2010-05-27 Thread Roslina Zakaria
Hi R-users,   I would like to search for the values of seq that match my rand values.  In excel I will use =VLOOKUP(G2,$E$2:$F$32,2).  For example, for rand=.262 it will give me approximately seq=120 and rand=0.964293344, seq=460 and etc.   E   F G cdf         seq   rand 0.00E+00   

[R] arrange data

2010-05-31 Thread Roslina Zakaria
Hi r-users,   I have a data below but I would like to rearrange my data so that it will be in the following format: year, month, day, rain.  I also would like the data to be arranged so that it will be continues for example year 1939 it will go from january 1 to december 31 and continue with

[R] horizontal and vertical line with arrow in a plot

2010-06-03 Thread Roslina Zakaria
Hi r-users, I would like to add a plot of vertical line segment with arrow from (77,.6) to (77,0) and also a horizontal  line segment with arrow from (0,0.6) to (77,.6) .  So far this is what I have: plot(sq, cdf, type=l, lwd=4,col=blue,xaxs=i,yaxs=i, xlab= Rainfall (mm), ylab= Random no.,

[R] fitting t copula

2010-06-09 Thread Roslina Zakaria
Hi r-users, I try to fit the t copula using the gamma marginals.  But I got error message which I don't really understand. Thank you for any help given. myCop.t - ellipCopula(family = t, dim = 2, dispstr = toep, param = 0.5, df = 8) myCop.t myMvd - mvdc(copula = myCop.t, margins = c(gamma,

[R] error message fitting tcopula

2010-06-10 Thread Roslina Zakaria
Hi r-users,   I really need help in fitting the t-copula.  I try to reproduce the example given by Jun Yan in “Enjoy the joy of copula” but I’m not sure how to correct the error based on the error message.  I tried so many ways but still could not get it working.   loglik.marg -

[R] sapply or apply

2010-06-16 Thread Roslina Zakaria
Hi r-users, I have this code here : dt   - winter_pos_sum bt   - c(24.96874, 19.67861, 23.51001, 19.86868); round(bt,2) alp  - c(2.724234, 3.914649, 3.229146, 3.120719); round(alp,2) bt_min  - min(bt) ; bt_min p   - alp_sum    ; p t  - 50 t1 - t+1     #first get the sum over the

[R] how to use sapply code

2010-06-16 Thread Roslina Zakaria
Hi, I have this code here and try to use sapply code.  But I got error message that I don't really understand to correct. bt   - c(24.96874, 19.67861, 23.51001, 19.86868); round(bt,2) alp  - c(2.724234, 3.914649, 3.229146, 3.120719); round(alp,2) bt_alp - data.frame(bt,alp) sapply(bt_alp,

[R] Bootstrap for correlation coefficient

2010-01-13 Thread Roslina Zakaria
I have the following code:   ## to check correlation between the simulated uniform data x2 - uni[,1] ; x2[1:10] y2 - uni[,2] ; y2[1:10] result2 - boot(cbind(x2,y2), f, 20) # get 95% confidence interval boot.ci(result2, type=bca) cor.test(x2,y2, method=pearson, conf.level=0.95)   part of my data:  

[R] Error meaning

2010-01-20 Thread Roslina Zakaria
Hi r-users,   I have the following code to solve 4 simultaneous eqns with 4 unknowns using newton iteration method.  But I got the error message:   pars - c(1.15, 40, 50, 0.78) newton.input2 - function(pars) {  ## parameters to estimate      alp - pars[1]    b1  - pars[2]     b2  - pars[3]   

[R] superimpose histogram and fitted gamma pdf

2010-01-20 Thread Roslina Zakaria
Hi r-users,   I try to draw histogram (in terms of probabilty) and superimpose with the gamma pdf. Using this code below I can get the plots BUT the y scale for the density is out of scale.  How do I change the y-axis scale to max 1?  Another thing, how I do draw smooth line rather that points?

[R] newton method for single nonlinear equation

2010-01-25 Thread Roslina Zakaria
Hi r-users,   I would like to solve for z values using newton iteration method.  I 'm not sure which part of the code is wrong since I'm not very good at programming but would like to learn.  There seem to be some output but what I expected is a vector of z values.  Thank you so much for any

[R] Check out this photo on MyDailyFlog!

2010-01-26 Thread Roslina Zakaria
Hello!!! I just uploaded a photo on zroslina's DailyFlog page that I want you to see. Check out: http://www.mydailyflog.com/go/invite_register/zroslina/56282492 Cheers! Got a digital camera? MyDailyFlog is a personal photo-blogging space where you

[R] Newton method

2010-01-26 Thread Roslina Zakaria
Hi r-users,   I hope somebody can help me with this code. I would like to solve for z values using newton iteration method.  I 'm not sure which part of the code is wrong since I'm not very good at programming but would like to learn.  There seem to be some output but what I expected is a

[R] I just uploaded a photo that I want you to see!

2010-01-26 Thread Roslina Zakaria
Hello! I just uploaded a photo on zroslina's DailyFlog page that I want you to see. Please come and see: http://www.mydailyflog.com/go/invite_register/zroslina/56282492stc=18 Thanks! Roslina Zakaria Got a digital camera? MyDailyFlog is a personal

[R] Problem to install Tinn-R_2.3.4.4

2010-01-28 Thread Roslina Zakaria
Hi r-users,   I manage to install the Tinn-R_2.3.4.4 successfully.  However, I cannot the execute my code and cannot open that window and get this message:   The preferred Rterm was not defined   and it suggest 'Options/main/R//path/Gui'.  What that mean and how to do it.   Thank you so mcuh

[R] problem with Tinn-R

2010-02-07 Thread Roslina Zakaria
Hi, I install Tinn-R 2.3.4.4 and when I want to execute the calculation, it gives me this error:   The preferred Rterm not defined.   Thank you so much for any help given. [[alternative HTML version deleted]] __ R-help@r-project.org

[R] how to adjust the output

2010-02-09 Thread Roslina Zakaria
Hi R-users,   I have this code below and I understand the error message but do not know how to correct it.  My question is how do I get rid of “with absolute error 7.5e-06” attach to value of cdf so that I can carry out the calculation.   integrand - function(z) { alp  - 2.0165  

[R] For and while in looping

2010-02-09 Thread Roslina Zakaria
I would like to solve a nonlinear eqn using newton method and here is the code:   library(numDeriv)   fprime - function(z) { alp  - 2.0165;   rho  - 0.868;   # simplified expressions   a      - alp-0.5   c1     - sqrt(pi)/(gamma(alp)*(1-rho)^alp)   c2     -

[R] looping problem

2010-02-09 Thread Roslina Zakaria
Hi R-users,   I have this code here: library(numDeriv)   fprime - function(z) { alp  - 2.0165;   rho  - 0.868;   # simplified expressions   a  - alp-0.5   c1 - sqrt(pi)/(gamma(alp)*(1-rho)^alp)   c2 - sqrt(rho)/(1-rho)   t1 - exp(-z/(1-rho))   t2 - (z/(2*c2))^a   bes1   -

[R] looping problem

2010-02-12 Thread Roslina Zakaria
Hi r-users,   I have this code below but I don't understand the error message:   cumdensity - function(z) { alp  - 2.0165;   rho  - 0.868;   # simplified expressions   a  - alp-0.5   c1 - sqrt(pi)/(gamma(alp)*(1-rho)^alp)   c2 - sqrt(rho)/(1-rho)   t1 - exp(-z/(1-rho))   t2     -

[R] error message error

2010-02-14 Thread Roslina Zakaria
Hi r-users,   I hope somebody can help me to understand the error message.  Here is my code; ## Newton iteration newton_gam - function(z) { n   - length(z)   r   - runif(n)   tol - 1E-6   cdf - vector(length=n, mode=numeric)   fprime - vector(length=n, mode=numeric)   f   - vector(length=n,

[R] extract the data that match

2010-02-16 Thread Roslina Zakaria
Hi r-users,   I would like to extract the data that match.  Attached is my data: I'm interested in matchind the value in column 'intg' with value in column 'rand_no' cbind(z=z,intg=dd,rand_no = rr)     z  intg rand_no    [1,]  0.00 0.000   0.001    [2,]  0.01 0.000   0.002    [3,]  0.02

[R] 2 ecdf from different set of data

2010-02-18 Thread Roslina Zakaria
Hi r-users,   I have 2 sets of data and I would like to superimpose this cumulative density in one graph.   I know how to put the 2 graphs in one same graph but my problem is the data are different.   z[1:20]  [1]  2.02347388  3.19514379  0.05188875  1.41333812  3.50249892  4.34272676 

[R] color graph in multiple plots

2010-02-18 Thread Roslina Zakaria
Hi,   I would like to distinguish my plots using colors but I got error message.  How do I correct that?     plot(ecdf(z), main =CDF for observed and simulated weighted sum,type=l,lwd=2,col=blue, xlab=Weighted sum (mm), ylab=Cumulative Percent, xlim=c(0,15), xaxs ='i', yaxs ='i',ylim=c(0,1))

[R] vloopkup or search function

2010-02-21 Thread Roslina Zakaria
Hi,   Does R has something similar  to vlookup function in excel?   Thank you for the info. [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the

[R] quantile-residual plot

2008-02-28 Thread Roslina Zakaria
Hi, What is quantile residuals? Thank you so much in advance. Be a better friend, newshound, and __ R-help@r-project.org mailing list

[R] tweedie model

2008-03-05 Thread Roslina Zakaria
Hi R users, Anybody using tweedie model to analyze rainfall data? Thanks in advance for your attention. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

[R] mean for each row

2008-03-16 Thread Roslina Zakaria
Hi r-users, How do find the mean for each row? Thank you in advance for your help. 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 Day Totals 10.0 0.0 0.0 0.0 0.6 0.0 8.4 0.0 29.4 0.0 38.4 20.0 0.0 1.8 0.0 22.4 0.0 0.2 0.4 0.8 0.0

[R] solver in R

2008-03-31 Thread Roslina Zakaria
Dear R-users, Is there any function in R that works similarly like solver in Excel. I have a set of daily rainfall data and I would like to estimate alpha and beta for the gamma function. Here is my daily rainfall data: [1] 0.2 1.2 0.0 0.0 0.0 0.0 0.0 0.6 0.0 0.0 0.0 0.0 0.0 0.0

[R] looping problem

2009-06-23 Thread Roslina Zakaria
Hi R-users,   I have this code below and use some code from sn package for multivariate skew t (rmst) to generate a set of random numbers.   I try to do a looping to produce ‘rand’ for different values of degrees of freedom (degf).  Actually, I’m not sure how to specify the

[R] tail probability

2009-06-24 Thread Roslina Zakaria
Hi r-users, If I have 10 data generated from multi skew-t distribution, how do I find the tail probability of alpha=.01? Thank you. [[alternative HTML version deleted]] __ R-help@r-project.org mailing list

[R] transform multi skew-t to uniform distribution

2009-07-06 Thread Roslina Zakaria
Hi R-users,  I have a data from multi skew t and would like to transform each of the data to uniform data.  I tried using 'pmst' but only got one output:   rr1 - as.vector(r1);rr1  [1]  0.7207582  5.2250906  1.7422237  0.5677233  0.7473555 -0.6020626 -2.1947872 -1.1128313 -0.6587316 -1.1409261  

[R] evaluate sum of sum

2009-07-15 Thread Roslina Zakaria
Hi R-users, Could anybody show me how to write a code to evaluate sum(z[i] + sum(k[j]*(z[i])^(k[j])), i=1 to 4, j=0 to infinity) ? Thank you so much for any help given. [[alternative HTML version deleted]] __ R-help@r-project.org

[R] detach and install package

2009-07-16 Thread Roslina Zakaria
Hi R-users, I would like to detach and installed the fBasics package but it gives me this message: detach(package:fBasics,unload=TRUE) Error in detach(package:fBasics, unload = TRUE) : invalid name install.packages(repos=NULL,pkgs=c:\\Tinn-R\\fBasics_2100.77.zip) package 'fBasics'

[R] tweedie model

2008-04-07 Thread Roslina Zakaria
Hi R-users, I have this code below for tweedie inverse, but I don’t understand why it doesn’t give zero for some of r1 values?   r1 - runif(31,0,1) p0 - 0.72 ; p - 1.63; mu - 1.48; phi - 9.61   tweedie.inv - function(rand,p0,p,mu,phi) {  y - rand    ind - rand p0    y[ind] - 0    y[!ind] -

[R] chi-square test

2008-04-08 Thread Roslina Zakaria
Hi R-users, I would like to find the goodness of fit using Chi-suare test for my data below: xobs=observed data, xtwe=predicted data using tweedie, xgam=predicted data using gamma xobs - c(223,46,12,5,7,17) xtwe - c(217.33,39,14,18.33,6.67,14.67) xgam - c(224.67,37.33,12.33,15.33,5.33,15)

[R] looping problem

2008-04-13 Thread Roslina Zakaria
Hi R-users, I would like to do looping for this process below to estimate alpha beta from gamma distribution: Here are my data: day_data1 - 123456 789 10 11 12 13 14 15 16 17 18 19 20 21 22 23 1943 48.3 18.5 0.0 0.0 18.3 0.0

[R] looping problem

2008-04-24 Thread Roslina Zakaria
Dear r-expert, I would like to generate 30 sets of random numbers from uniform distribution (0,1). Each set of random numbers should have 90 data.  Here is my code: rand.no - function(n,itr) { for (i in 1:itr)   {rand.1 - runif(n,0,1)   if (i ==1) rand.2 - rand.1   else rand.2 -

[R] to extract particular date/data

2008-05-01 Thread Roslina Zakaria
Hi R-expert, If I have this daily rainfall data, how do call a particular day? Year,Month,Day,Amount 1900,12,22,1.3 1900,12,23,0 1900,12,24,0 1900,12,25,0 1900,12,26,0 1900,12,27,0 1900,12,28,0 1900,12,29,4.8 1900,12,30,0.3 1900,12,31,0.5 1901,1,1,0 1901,1,2,3 1901,1,3,0 1901,1,4,0.5 1901,1,5,0

[R] convert S-Plus function to R function

2008-05-06 Thread Roslina Zakaria
Hi R-expert, If I have this daily rainfall data, how do call a particular set of data? Year,Month,Day,Amount 1981,1,1,0 1981,1,2,0 1981,1,3,78 1981,1,4,22 1981,1,5,2 1981,1,6,0 1981,1,7,0 1981,1,8,0 1981,1,9,0 1981,1,10,10 1981,1,11,0 1981,1,12,108 1981,1,13,328 1981,1,14,10 1981,1,15,0

[R] histogram

2008-05-08 Thread Roslina Zakaria
Dear R-expert, For histogram function, can we get the table of bin and frequency like in excel, together with the histogram? Therefore, we can check the number of data included. Thank you so much for your attention and help.

[R] How to eliminate perticular date

2008-05-11 Thread Roslina Zakaria
Hi R-expert, I try to eliminate 29 Feb but I got an error message below: feb_data1 - Pooraka_data[Pooraka_data$Month==2,] feb_28days - feb_data1 [feb_data1$Day==28,] feb_29days - feb_data1 [feb_data1$Day==29,] ## delete 29 Feb feb_no_29 - feb_data1 [-(feb_29days),] feb_no_29 - feb_data1

[R] plot 2 bars

2008-05-13 Thread Roslina Zakaria
 Hi r-expert, How do I plot this 2 histogram side by side so that it is easy to compare for bin range 0,5,10,15, 20 and more     obs_data  pre_gam [1,] 2695 2677.284 [2,]   43   61.101 [3,]   20   29.016 [4,]   14   11.160 [5,]   18   11.439 Thanks in advance.

[R] histogram

2008-05-16 Thread Roslina Zakaria
Hi r-expert, I would like to plot histogram using frequency not density. But I got the following warning.  obs.hist - hist(jan_data2[,4],right=FALSE,breaks=c(0,5,10,15,20,100),freq=TRUE, + xlab=Rain amt (mm),ylim=c(0,3000), + main=Frequency of observed, Jan (1901-1990),

[R] How to swap and rearrange rows?

2008-05-16 Thread Roslina Zakaria
Dear R-expert, How to swap and rearrange the row so that I will have Jan-Dec in order? est31     p0 est.alpha est.beta  est.rate Jan  0.8802867 0.7321440 7.241757 0.1380880 Mar  0.8598566 0.7096567 7.376367 0.1355681 May  0.6204301 0.8657272 6.036106 0.1656697 July 0.5032258 0.9928488

[R] How to paste graph from R in Latex?

2008-05-16 Thread Roslina Zakaria
Dear R-expert, Is it possible to save graph from R into Latex document? I can see save as metafile , PNG, pdf etc, but I'm not sure which one to use. Thank  you so much for your help. __ R-help@r-project.org mailing list

[R] estimate alpha beta for gamma

2009-04-29 Thread Roslina Zakaria
Hi R-users, I'm not sure what's wrong and how do I check the error? I have 3 sets of data aug_dt1  [1]  22.8  49.6  77.9  67.6  91.2  48.9 124.6  54.6  85.8  62.8  63.3 174.7  32.3  22.7  99.9 123.2   4.8 149.0  66.0 [20]  73.9  37.4  22.4  69.5  87.3  66.9  87.2  81.5 109.1  47.4  22.8 

[R] need help - small code

2009-05-01 Thread Roslina Zakaria
Hi R-users,   I would like to transform my data using gamma, my data are ahll, bhall and dp1 as shown below:   ahall      ah1  ah2  ah3  ah4  ah5  ah6  ah7  ah8  ah9 ah10 ah11 ah12 [1,] 0.9 1.01 1.24 1.85 1.85 2.45 3.67 3.02 3.06 2.33 1.86 0.96   bhall        bh1   bh2 

[R] data transformation using gamma

2009-05-07 Thread Roslina Zakaria
Hi R-users, I have this code to uniformise the data using gamma: length(dp1) [1] 696 dim(dp1) [1] 58 12 dim(ahall) [1]  1 12 dim(bhall) [1]  1 12 trans_dt - function(dt,a,b) + { n1 - ncol(dt) +   n2 - length(dt) +   trans  - vector(mode='numeric', length=n2) +   dim(trans) - dim(dt) +  

[R] Asymmetric t - copula code in R

2009-05-17 Thread Roslina Zakaria
Hi R-users, Where can I find the code for asymmetric t-copula in R? Thank you for any help given. [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read

[R] asymmetric t-copula in R

2009-05-17 Thread Roslina Zakaria
Hi R-users, Where can I find the code for asymmetric t-copula in R? Thank you for any help given. [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read

[R] Asymmetric t-copula code?

2009-05-20 Thread Roslina Zakaria
Hi R-users, Anybody got any idea where can I find the code for asymmetric t-copula? I found the copula package written by Jun Yan. Thank you so much for any help given. [[alternative HTML version deleted]] __ R-help@r-project.org

[R] (no subject)

2009-05-31 Thread Roslina Zakaria
Hi R-users, I try to use sn package but it give me the following message: install.packages(repos=NULL,pkgs=c:\\Tinn-R\\sn_0.4-12.zip) Warning: package 'sn' is in use and will not be installed updating HTML package descriptions I did tried a few time to save the .zip file but it give me the

[R] newton method

2009-03-22 Thread Roslina Zakaria
Hi R-users, Does R has a topic on newton's method? Thank you for the info. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide

[R] sum to infinity

2009-03-25 Thread Roslina Zakaria
Hi r-users, How do we evaluate the summation of (1/m!) from 0 to infinity (for example). Any help is very much appreciated. Thank you. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

[R] Maple and R

2009-04-07 Thread Roslina Zakaria
Hi R-users, Can Maple function be exported to R? I have a jacobian matrix (4X4) from maple in algebraic form which involve modified Bessel function of the first kind. I just wonder whether we can use algebraic form into R before the value of the parameters can be estimated. Thank you so much

[R] Newton method again

2009-04-07 Thread Roslina Zakaria
Hi Rolf, I would like to extend the problem that I asked you before regarding the newton method using 4 functions with 4 parameters.  My functions involve the modified bessel function of the first kind which I can type them without any problem. The big problem is the Jacobian matrix. I use

[R] Jacobian

2009-04-13 Thread Roslina Zakaria
Hi R-users,  I would like to use jacobian function from numDeriv package.  If I have more than one parameters how do I modify it? This is the example given in the package: func2 - function(x) c(sin(x), cos(x))    x - (0:1)*2*pi    jacobian(func2, x) Can I do the following: z - c(x,y) func2

[R] to extract data

2009-04-20 Thread Roslina Zakaria
Hi R-users, I have a set of data from 1958-2009, how do I extract the data from 1927 and 2007?   beechworth.dt Year Month  Rain 1    1858 3  21.8 2    1858 4  47.0 3    1858 5  70.1 4    1858 6  78.7 5    1858 7 101.6 6    1858 8 129.8 7    1858 9  80.8 8   

[R] problem with new version

2009-04-20 Thread Roslina Zakaria
Hi R-users, I just change to the new version of R.  I just wonder why everytime I run my function I will get this message: source(.trPaths[4], echo=TRUE, max.deparse.length=1) Thank you. __ R-help@r-project.org mailing list

[R] Copula package

2009-04-22 Thread Roslina Zakaria
Hi R-users, I would like to use the copula package.  I  the package plus the mvtnorm and try to run the example given, but I got the following message: install.packages(repos=NULL,pkgs=c:\\Tinn-R\\copula_0.8-3.zip) norm.cop - normalCopula(c(0.5, 0.6, 0.7), dim = 3, dispstr = un) t.cop -

[R] Tinn-R and latex

2009-04-24 Thread Roslina Zakaria
Hi R-users, I installed new version of R and Tinn-R and I just wonder why all my latex document change to Tinn-R symbol? Thank you. [[alternative HTML version deleted]] __ R-help@r-project.org mailing list

[R] extract positive pairs

2009-01-27 Thread Roslina Zakaria
Hi, I have a data below and would like to search for positive pairs only and form a new data set.    X1             X2 31.0 9.0 11.0 1.0 1.0 0.0 0.0 0.0 8.0 0.0 0.0 0.0 2.0 2.0 18.0 3.0 0.0 0.0 0.0 0.0 0.0 0.0 10.0 0.0 6.0 0.0 ... The new data will be X1'   X2' 31.0 9.0

[R] hypergeometric function

2008-12-03 Thread Roslina Zakaria
Hi,   I hope somebody can help me on how to use the hypergeometric function.  I did read through the R documentation on hypergeometric but not really sure what it means.   I would like to evaluate the hypergeometric function as follows: F((2*alpha+1)/2, (2*alpha+2)/2 , alpha+1/2, betasq/etasq).  

[R] recursive term

2008-12-09 Thread Roslina Zakaria
Hi,   I would like to write a function for this formula: F(a,b,c,z)=1+(ab)/(1!c)+ +(a(a+1)b(b+1))/(2!c(c+1))+ +(a(a+1)(a+2)b(b+1)(b+2))/(3!c(c+1)(c+2))+…   I wrote this function but not sure what is not right:   hypergeo_sum - function (a,b,c,z,n) { for (i in 1:n)   { aa - 1+(a*b*z)/c   aa[i] -

[R] Plot 2 ecdf in one graph

2009-09-06 Thread Roslina Zakaria
Hi r-users,   I would like to compare the cdf between historical and predicted. My x.obs and x.pre are the frequency data in classes of 0-300. I tried: plot(ecdf(x.obs),ecdf(x.pre),type=l,col=red)   and it gives me: Error in plot.stepfun(x, ..., ylab = ylab, verticals = verticals, pch = pch) :

[R] (no subject)

2009-09-06 Thread Roslina Zakaria
Hi r-users,   I would like to know how to put all the data that is greater than certain value in certain cell for my histogram.  For example, since maximum value of p1 is 588 it doesn't fit in the breaks that we specified.  Can we write breaks 300?   max(p1[,2]) pre.hist - hist(p1[,2],breaks =

[R] numerical integration

2009-09-10 Thread Roslina Zakaria
Hi r-users,   Can I do a numerical integration in R to solve for F(z)- integral_0^z {f(t) dt} = 0 where F(z) is the CDF and f(t) is the pdf?  What package can I use?   Thank you so much for any help given. [[alternative HTML version deleted]]

[R] code for empirical copula

2010-03-02 Thread Roslina Zakaria
Hi,   I hope somebody can give me an idea where can I can find the code for empirical copula. I have a bivariate data.   Thank you so much for your help. [[alternative HTML version deleted]] __ R-help@r-project.org mailing list

[R] empirical copula code

2010-03-03 Thread Roslina Zakaria
Hi all, I have this data set: ## Empirical copula ## dt1 = ranking ## dt2 = observed uniform data associated with the ranking   Sample data, dt1     S_i   R_i  [1,]   7.0  10.0  [2,] 232.5 440.5  [3,] 143.0 141.5  [4,] 272.5 222.0  [5,]  46.0  34.0  [6,] 527.0 483.0  [7,] 420.5 563.5  [8,] 

[R] recursive term

2010-03-16 Thread Roslina Zakaria
Hi r-users;   I have this values: eign_val - c(137.810447,3.538721,2.995161,1.685670) alp    - 1.6549 ;  lamda - eign_val lamda_m - min(lamda)   First I calculated manually: delta0 - 1 delta1 - alp*delta0*(4-lamda_m*(1/lamda[1]+1/lamda[2]+1/lamda[3]+1/lamda[4]))  delta1 delta2 -

[R] any quick way to write this label

2010-03-28 Thread Roslina Zakaria
Hi r-users,   Is there any quick way to write this label?   c(0,50,100,150,200,250,300,350,400,450, 500,550,600,650,700,750,800,850,900)   Thank you. [[alternative HTML version deleted]] __ R-help@r-project.org mailing list

[R] (no subject)

2010-03-30 Thread Roslina Zakaria
Hi r-users,   I would like to display my legend with fill box and line symbol.  The first color will be in the box and the second colour will just be a line.   legend(topright, c(observed,gamma sum fit), col= c(greenyellow,red),pch=c(15, NA),lty = c(0,1),lwd=2)   Is it possible?   Thank

[R] barplot and line

2010-03-31 Thread Roslina Zakaria
Hi r-users,   I have this data below and would like to plot a barplot overlap with a line. This is my data: hist_50     pdf_obs pdf_gen.50 1  0.00   0.00 2  0.083156   0.125366 3  0.132196   0.158230 4  0.126866   0.149432 5  0.120469   0.127897 6  0.121535   0.104096 7  0.103412  

[R] extract data

2012-04-04 Thread Roslina Zakaria
HI, I would like to extract data in a specific way.  For example, the rainfall data 0,0,1.5,0,0, 3,1,2.5,0,0,0,0, 2.3,0,0,0, 2.1,1.4,0,0,0, 3,2,1,0,0,0... data_1: 1.5, 2.3   ( a single nonzero data between zeros data) data_2: 3.1, 2.5, 2.1,1.4   ( two nonzero data between zeros

  1   2   >