Re: [R] R cairo_pdf function does not respect plotting boundaries

2019-03-05 Thread Lee Steven Kelvin
re committing that change. Paul On 1/03/19 8:13 AM, Lee Steven Kelvin wrote: Hello all, When producing a plot in R using the cairo_pdf device, the resultant plot does not respect the plotting boundaries. Lines and shaded regions will spill over the lower x-axis and the right-side y-axis (sid

[R] R cairo_pdf function does not respect plotting boundaries

2019-02-28 Thread Lee Steven Kelvin
ting-boundaries Thank you in advance for any insights into this issue. Sincerely, Lee Kelvin -- Dr Lee Kelvin Department of Physics UC Davis One Shields Avenue Davis, CA 95616 USA Ph: +1 (530) 752-1500 Fax: +1 (530) 752-4717 [[alternative HTML version deleted]]

Re: [R] How to formulate quadratic function with interaction terms for the PLS fitting model?

2017-07-16 Thread Ng, Kelvin Sai-cheong
LS > >> gas1 <- plsr(octane ~ NIR, ncomp = 10, data = gasTrain, validation = > "LOO") > >> where octane ~ NIR is the model that this example is fitting with. > >> NIR is a collective of variables, i.e. NIR spectra consists of 401 > diffuse &

[R] Quadratic function with interaction terms for the PLS fitting model?

2017-07-12 Thread Ng, Kelvin Sai-cheong
NIR[0,i]*NIR[1,i] + ... i.e. quadratic with interaction terms. But I don't know how to formulate this. May I have some help please? Thanks, Kelvin [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and

[R] How to formulate quadratic function with interaction terms for the PLS fitting model?

2017-07-12 Thread Ng, Kelvin Sai-cheong
i.e. quadratic with interaction terms. But I don't know how to formulate this. May I have some help please? Thanks, Kelvin [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see http

[R] R2WinBUGS with Multivariate Logistic Regression

2016-07-16 Thread Christopher Kelvin via R-help
Dear R-User, I have written a simple code to analyze some data using Bayesian logistic regression via the R2WinBUGS package. The code when run in WinBUGS stops WinBUGS from running it and using the package returns no results also. I attach herewith, the code and a sample of the dataset. Any

Re: [R] Clarification on Simulation and Iteration

2015-07-31 Thread Christopher Kelvin via R-help
On Saturday, August 1, 2015 3:32 AM, David Winsemius dwinsem...@comcast.net wrote: On Jul 31, 2015, at 6:36 PM, Christopher Kelvin via R-help wrote: Dear All, I am performing some simulations for a new model. I run about 10,000 iterations with a sample of 50 datasets and this returns one set

[R] Clarification on Simulation and Iteration

2015-07-31 Thread Christopher Kelvin via R-help
Dear All, I am performing some simulations for a new model. I run about 10,000 iterations with a sample of 50 datasets and this returns one set of 50 simulated data. Now, what I need to obtain is 10 sets of the 50 simulated data out of the 10,000 iterations and not just only 1 set. The model

[R] Problem with Newton_Raphson

2012-09-20 Thread Christopher Kelvin
- (p[1])*sum(s)*log((exp(-(p[2])*sum(x   return(-log1)   } }   start - c(1,1)   zz-optim(start,fn=z,data=q,hessian=T)   zz   m1-zz$par[2]   p-zz$par[1]  Thank you Chris Kelvin INSPEM. UPM __ R-help@r-project.org mailing list https://stat.ethz.ch

Re: [R] Problem with Newton_Raphson

2012-09-20 Thread Christopher Kelvin
) -(scale)*sum(x) + (shape)*log((exp(-(scale)*sum(x- (shape)*sum(s)*log((exp(-(scale)*sum(x   return(-log1)   }   start - c(1,1)   zz-optim(start,fn=z,data=q,hessian=T)   zz Thank you Chris Kelvin - Original Message - From: Berend Hasselman b...@xs4all.nl To: Christopher

Re: [R] Problem with Newton_Raphson

2012-09-20 Thread Christopher Kelvin
Thank you very much for everything. Your suggestions were very helpful.  Chris - Original Message - From: Berend Hasselman b...@xs4all.nl To: Christopher Kelvin chris_kelvin2...@yahoo.com Cc: r-help@r-project.org r-help@r-project.org Sent: Thursday, September 20, 2012 10:06 PM Subject

[R] Optim Problem

2012-08-27 Thread Christopher Kelvin
Hello, I want to estimate the exponential parameter by using optim with the following input, where t contains 40% of the data and q contains 60% of the data within an interval. In implementing the code command for optim i want it to contain both the t and q data so i can obtain the correct

[R] problem with ifelse

2012-05-30 Thread Christopher Kelvin
((       for(i in 1:length(t)){         for(j in 1:length(v-1))          { ifelse ((t[i]v[j] t v[j+1] ),{z[i]-v[j];s[i]-v[j+1]},NA)}}        return(cbind(z,s))}  y(t,v) Chris Kelvin Institute for Mathematical Research UPM __ R-help@r-project.org

[R] standard error

2012-05-28 Thread Christopher Kelvin
Dear all,  I want to determine the standard error or the mean squared error for the parameter estimate for beta and eta base on the real data.  Any help on how to obtain these estimated errors. library(survival) d - data.frame(ob=c(149971, 70808, 133518, 145658, 175701, 50960, 126606, 82329),

[R] How to replace NA with zero (0)

2012-05-03 Thread Christopher Kelvin
Hello,  When i generate data with the code below there appear NA as part of the generated data, i prefer to have zero (0) instead of NA on my data. Is there a command i can issue to replace the NA with zero (0) even if it is after generating the data?  Thank you library(survival)

[R] interval censoring

2012-04-23 Thread Christopher Kelvin
Hello, May i know whether it is possible to generate data twice from Weibull distribution and use one as the start time and the  other as the end time, below is my code. Any suggestion on how to estimate the parameters of Weibull distribution with interval data will be highly appreciated. Thank

[R] standard error

2012-04-23 Thread Christopher Kelvin
Hello, I have tried obtaining the value of standard error from the code below but i get different values when i compare it with the  standard error obtained from the hessian matrix. Can somebody help me out? Thank you n=100;rr=1000 p1=1.2;b=1.5 sq11=sq21=0 for (i in 1:rr){

[R] Standard error

2012-04-22 Thread Christopher Kelvin
Hello, I have tried obtaining the value of standard error from the code below but i get different values when i compare it with the  standard error obtained from the hessian matrix. Can somebody help me out? Thank you n=100;rr=1000 p1=1.2;b=1.5 sq11=sq21=0 for (i in 1:rr){

[R] Interval censorin

2012-04-21 Thread Christopher Kelvin
Hello, May i know whether it is possible to generate data twice from Weibull distribution and use one as the start time and the  other as the end time, below is my code. Any suggestion on how to estimate the parameters of Weibull distribution with interval data will be highly appreciated. Thank

[R] R: Help; error in optim

2012-04-15 Thread Christopher Kelvin
Hello, When i run the code below from Weibull distribution with 30% censoring by using optim i get an error form R, which states that Error in optim(start, fn = z, data = q, hessian = T) :    objective function in optim evaluates to length 25 not 1 can somebody help me remove this error. Is my

[R] R-Help: Censoring data

2012-04-13 Thread Christopher Kelvin
Hello,  I want to estimate weibull parameters with 30% censored data. I have below the code for the censoring  but how it must be put into the likelihood equation to obtain the desire estimate is where i have a problem with,  can some body help?  My likelihood equation is for a random type-I

[R] R-help; generating censored data

2012-04-11 Thread Christopher Kelvin
Hello,  can i implement this as 10% censored data where t gives me failure and x censored. Thank you p=2;b=120 n=50 set.seed(132); r-sample(1:50,45) t-rweibull(r,shape=p,scale=b) t set.seed(123);  cens - sample(1:50, 5)  x-runif(cens,shape=p,scale=b)  x Chris Guure Researcher, Institute for

[R] R-help; Censoring

2012-04-10 Thread Christopher Kelvin
Hello, I wish to censor 10% of my sample units of 50 from a Weibull distribution. Below is the code for it. I will need to know whether what i have done is correct and if not, can i have any suggestion to improve it? Thank you  p=2;b=120 n=50 r=45 t-rweibull(r,shape=p,scale=b)

[R] simulation

2012-04-05 Thread Christopher Kelvin
Hello, i need to simulate 100 times, n=40 ,  the distribution has 90% from X~N(0,1) + 10% from X~N(20,10) Is my loop below correct? Thank you n=40 for(i in 1:100){ x-rnorm(40,0,1)  # 90% of n z-rnorm(40,20,10)  # 10% of n } x+z __

[R] matrix with Loop

2012-03-29 Thread Christopher Kelvin
Hello! I got something to ask..whether you can help me with the R program...i got this for example 5x4 matrix..and i want to find:  i) mean for each row of the matrix ii) median for each column of the matrix and i need to do this using a loop function...below is my program..u try to check it for

[R] R- Fisher Information

2012-02-05 Thread Christopher Kelvin
Dear All, Can you help me, with the code below how do I obtain the fisher information from it. Is my q-replicate(1000,x) the right way to do simulation. thank you. x-rweibull(100,0.8,1.5) q-replicate(1000,x) z-function(p){ beta-p[1] eta-p[2]

[R] Fisher Imformation

2012-02-04 Thread Christopher Kelvin
Hello, i have used the code below to estimate the parameters of weibull distribution and i want to obtain the fisher information by providing the the next code but i receive errors anytime i try to, what do i do? by the way is my replication correct and is it placed at the right position for

[R] r-help; fisher information

2012-02-01 Thread Christopher Kelvin
Hello, i have used the code below to estimate the parameters of weibull distribution and i want to obtain the fisher information by providing the the next code but i receive errors anytime i try to, what do i do? by the way is my replication correct and is it placed at the right position for

[R] parameter estimate

2012-01-30 Thread Christopher Kelvin
I need help, the codes below estimates the weibull parameters with complete failure, my question is how do i change the state to include some censoring (may be right, type-I or type-II) to generate and estimate the parameters. thank you x=rweibull(10,2,2) library(survival)

[R] r-help; parameter estimate

2012-01-30 Thread Christopher Kelvin
I need help, the codes below estimates the weibull parameters with complete failure, my question is how do i change the state to include some censoring (may be right, type-I or type-II) to generate and estimate the parameters. thank you x=rweibull(10,2,2) library(survival)

[R] r-help; weibull parameter estimate

2012-01-29 Thread Christopher Kelvin
Hello, If i write a function as below using log of weibull distribution i do not get the required results in estimating the parameters what do i do, please a/b * (t/b)^a-1 * exp(-t/b)^a n=500 x-rweibull(n,2,2) z-function(p) {(-n*log(p[1])+n*log(p[2])-

[R] r-help; weibull distribution

2012-01-29 Thread Christopher Kelvin
 Please, Help me, How do I generate data from the weibull distribution if the data contain both failure and interval censored, For example, I want to generate n=100, shape=2 and scale =4 with 30% interval censored.  What about right censoring Thank you  [[alternative HTML version

[R] R-HELP

2012-01-27 Thread Christopher Kelvin
please help; I want to know how to generate an interval-censored data of about 20% and a right censored data of about 30%  using the weibull distribution of say, x=rweibull(100,shape=1.2,scale=1.5) [[alternative HTML version deleted]] __

[R] R-Help

2012-01-27 Thread Christopher Kelvin
Can somebody help me, How do I generate data from the weibull distribution if the data contain both failure and interval censored, For example, I want to generate n=100, shape=2 and scale =4 with 30% interval censored. Thank you [[alternative HTML version deleted]]

[R] R-help mailing list submissions

2012-01-27 Thread Christopher Kelvin
R-help mailing list submissions [[alternative HTML version deleted]] __ 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] Simulation numbers from a probability table

2010-01-13 Thread Kelvin
above? A B C D ... 0 4 2 0 2 2 0 1 0 1 4 1 2 2 0 0 ... Thanks for help! Kelvin __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http

[R] Calculate the percentages of the numbers in every column.

2010-01-12 Thread Kelvin
0.3 0.1 0.1 1 0.1 0.1 0.2 0.1 2 0.1 0.2 0.2 0.2 3 0.2 0.1 0.1 0 ... Thanks your help! Kelvin __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http

[R] Using WCSLIB in R

2009-10-25 Thread Lee Kelvin
this library before, and if so how? Thankyou in advance, Lee Kelvin -- School of Physics Astronomy University of St Andrews North Haugh St Andrews KY16 9SS United Kingdom Phone (+44) [0]1334461668 Email l...@st-andrews.ac.uk __ R-help@r-project.org

Re: [R] Problems with loading 'wordnet' in a standalone pc

2009-08-25 Thread Kelvin Lam
Thanks Uwe. The wordnet is working now. My previous configuration that causes the error was: R - version 2.9.1 wordnet - version 0.1-4 rJava 0.6-2 After updating rJava to version 0.7-0 everything works now. Uwe Ligges-3 wrote: Looks like nobody answered so far: Kelvin Lam wrote

[R] Problems with loading 'wordnet' in a standalone pc

2009-08-20 Thread Kelvin Lam
failed for 'wordnet' My guess is I miss something from the namespace but unfortunately I can't get to the internet. Does anyone know what I'm missing (from the namespace?). Thank you very much! Kelvin -- View this message in context: http://www.nabble.com/Problems-with-loading-%27wordnet%27

[R] extracting text from wordnet using synonym()

2009-08-15 Thread Kelvin Lam
\) [2] c(\aid\, \assistance\, \help\) How can I get a one character string at the end that looks like this: [1] aid assist assistance help aid assist help Thanks for the help! Kelvin -- View this message in context: http://www.nabble.com/extracting-text-from-wordnet-using

Re: [R] extracting text from wordnet using synonym()

2009-08-15 Thread Kelvin Lam
...@gmail.com wrote: Try this: Str - c(c(\aid\, \assist\, \assistance\, \help\),         c(\aid\, \assistance\, \help\)) unlist(sapply(Str, function(x)dget(textConnection(x)), USE.NAMES = FALSE)) On Sat, Aug 15, 2009 at 6:33 PM, Kelvin Lam lamk...@gmail.com wrote: Dear group

Re: [R] How to Import Excel file into R 2.9.0 version

2009-08-11 Thread Kelvin Lam
Use odbcConnectExcel() in the RODBC package. rajclinasia wrote: Hi Every one, I have a problem with Reading Excel file into R 2.9.0 version. In older versions it is working with xlsReadWrite package. But in 2.9.0 version there is no package like that. so help me out in this aspect.

[R] re placePatterns() for multiple words replacement in tm

2009-08-11 Thread Kelvin Lam
Hi all, I wonder how you can replace all words that need to be changed using replacePatterns(). The following is my code. I want to replace both abc and def to Yes . However, I can only replace the first occurrence in sample[[1]]. sample[[1]] [1] abc def ghi change - c(abc,def)

Re: [R] re placePatterns() for multiple words replacement in tm

2009-08-11 Thread Kelvin Lam
R function. Ergo, possibility of confusion. Bert Gunter Genentech Nonclinical Biostatisics -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Kelvin Lam Sent: Tuesday, August 11, 2009 9:43 AM To: r-help@r-project.org

[R] Sorting text docs based on document meta values in tm()

2009-08-10 Thread Kelvin Lam
Hi all, I wonder if there's any way to reshuffle the text collection by the document meta values. For instance, if I have 5 documents that correspond to the following meta data: MetaID Sex Age 0 M38 0 M46 0 F 24 0 F 49 0 F 33 Can I

Re: [R] Entire Organization Switching from SAS to R - Any experience?

2009-07-17 Thread Kelvin Lam
I should elaborate the situation a bit more. We store our data in UNIX and have been using UNIX SAS for our work. My Biostat dept has 40 SAS users from which at most 10 also use R. The Epi/Grad Students/Investigators combine for another 30-40 not-so-frequent SAS users let alone R. So we are

[R] (newbie) sum for certain number of rows

2009-07-15 Thread kelvin lau
but so far haven't managed to find it. I am extremely grateful if someone can point me how to go about it. Thanks. Kelvin __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R

Re: [R] (newbie) sum for certain number of rows

2009-07-15 Thread kelvin lau
To: kelvin lau kelvin...@yahoo.com Cc: r-help@r-project.org Date: Wednesday, July 15, 2009, 6:25 PM one way is the following: dat - read.table(textConnection( 0 0 1 0 0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 1 1 0 1 0 0 0 1 1 0 0 0 0 1 1 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 1 0 1 1 0 1 0 1 1 1 1 1 1 1 1 1 1

[R] Fractional Polynomials (mfp) for Weibull Model

2009-06-18 Thread Lam, Kelvin
. I wonder if any of you can give me some tips on how to modify it or any experience modelling other survival models besides Coxph. Thank you very much! Regards Kelvin Lam, MSc. Analyst, Programming Biostatistics Institute for Clinical Evaluative Sciences (ICES) G179 - 2075 Bayview Avenue

[R] Bivariate Survival Analysis

2007-12-14 Thread Lam, Kelvin
Hi group, Can someone kindly inform which package deals with Bivariate Survival Analysis. I did a search but nothing came up. Thanks! Regards, Kelvin ___ This email may contain confidential and/or privileged