[R] how to specify the multinomial distribution in R

2012-09-25 Thread zhijie zhang
. -- With Kind Regards, oooO: (..): :\.(:::Oooo:: ::\_)::(..):: :::)./::: ::(_/ : [***] ZhiJie Zhang,MD,PhD Dept.of Epidemiology, School of Public Health,Fudan University Office:Room 443

Re: [R] Join points with arrows based a TIME variable

2009-11-04 Thread zhijie zhang
[length(x)], y[length(x)])) 2009/11/4 Uwe Ligges lig...@statistik.tu-dortmund.de zhijie zhang wrote: Hi, I have a data set with three variables,X Y and Time. X and Y are the coordinates of points, i want to join these points according to the Time sequence using arrows? Demo Example data

Re: [R] Join points with arrows based a TIME variable

2009-11-04 Thread zhijie zhang
Hi Uwe, I mistook the arguments for the function of arrows. I understand now. Thanks again. 2009/11/5 Uwe Ligges lig...@statistik.tu-dortmund.de zhijie zhang wrote: Hi Uwe, It works. Why does the following argument generate different results? with(data, arrows(x[-length(x)], y

[R] Join points with arrows based a TIME variable

2009-11-03 Thread zhijie zhang
Hi, I have a data set with three variables,X Y and Time. X and Y are the coordinates of points, i want to join these points according to the Time sequence using arrows? Demo Example data: x-c(1:6) y-c(1:6) time-c(6:1) data-cbind(x,y,time) data x y time [1,] 1 16 [2,] 2 25 [3,] 3

Re: [R] Creating a Clustered-Stacked Column Chart

2009-10-10 Thread zhijie zhang
) There are adjustments available to the space between bars. barchart(Titanic, scales = list(x = free), auto.key = list(title = Survived), horizontal=FALSE, box.ratio=100) On Oct 9, 2009, at 9:57 PM, zhijie zhang wrote: Thanks a lot. Maybe someone else has the method to solve that. 2009

Re: [R] Creating a Clustered-Stacked Column Chart

2009-10-10 Thread zhijie zhang
...@ucalgary.ca I think you're missing the point. David _did_ show you how to create a graph showing 4 clusters of stacked barcharts. If you want them side-by-side instead of in the matrix layout David gave, use the layout= argument. -Peter Ehlers zhijie zhang wrote: Hi David, Your codes

[R] Creating a Clustered-Stacked Column Chart

2009-10-09 Thread zhijie zhang
Hi all, In R, is there some functions or ways to create a Clustered-Stacked Column Chart as the example in the following page http://peltiertech.com/Excel/ChartsHowTo/ClusterStack.html? I have browsed the R Graph Gallery (http://addictedtor.free.fr/graphiques/) and searched the R site, and

Re: [R] Creating a Clustered-Stacked Column Chart

2009-10-09 Thread zhijie zhang
/ for an alternative method of displaying the data using lattice. --- On Fri, 10/9/09, zhijie zhang rusers...@gmail.com wrote: From: zhijie zhang rusers...@gmail.com Subject: [R] Creating a Clustered-Stacked Column Chart To: r-h...@stat.math.ethz.ch Received: Friday, October 9, 2009, 5:31 AM Hi all

[R] cannot allocate a vector with 1920165909 length

2009-07-28 Thread zhijie zhang
Dear Rusers, The error for the following was that it cannot allocate the vector of length 1920165909. a - expand.grid(se1=0:100/100, sp1=0:100/100, se2=0:100/100, sp2=0:100/100, DR=0:100/100) How to solve it? Maybe setwd(dir) can, i am not very sure about it. Any ideas about it?

[R] How should i change the SAS Codes into R Codes?

2009-07-27 Thread zhijie zhang
Dear R users, I have a SAS codes with several loops in it, and i hope to use R to do the same task. The SAS codes are as follows, /*to generate the dataset*/ DATA Single_Simulation; DO se=0 to 1 by 0.01; DO sp=0 to 1 by 0.01; DO DR=0 to 1 by 0.01; TR=(DR+sp-1)/(se+sp-1+1.0e-12);

Re: [R] How should i change the SAS Codes into R Codes?

2009-07-27 Thread zhijie zhang
Meunchen's book Muenchen, R. A. (2008). R for SAS and SPSS Users (1st ed.). Springer. useful. A shorter version is available as a pdf at http://rforsasandspssusers.com/. The pdf is a very useful guide for anyone beginning to use R. --- On Mon, 7/27/09, zhijie zhang rusers...@gmail.com wrote: From

[R] Does R have function or method to finish my task?

2009-03-05 Thread zhijie zhang
Dear all, Does R have function or method to finish the following task. Say i have a dataset. The response variable is Y, and the indepedent variables are X1, X2, X3, and YEAR. See an example. Y X1X2X3 X4YEAR 13.4 2.8 3.5

Re: [R] Does R have function or method to finish my task?

2009-03-05 Thread zhijie zhang
801.408.8111 -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- project.org] On Behalf Of zhijie zhang Sent: Thursday, March 05, 2009 8:56 AM To: r-h...@stat.math.ethz.ch Subject: [R] Does R have function or method to finish my task? Dear all

Re: [R] glmer documentation

2009-01-17 Thread zhijie zhang
r-sig-mixed-mod...@r-project.org maybe more appropriate for your question. You may find answers there. 2009/1/17 Raphaelle rmet...@rvc.ac.uk Hello, I am fitting a gmler using poisson, and I was looking for a documentation to interpret correctly the output. I'm quite a beginner with these

[R] Where to find the source codes for the internal function in stats package

2009-01-16 Thread zhijie zhang
Dear all, I want to see the source codes for dchisq(x, df, ncp=0, log = FALSE), but cannot find it. I input dchisq in the R interface, and then enter, the following message return: dchisq /*/ function (x, df, ncp = 0, log = FALSE) { if

[R] Questions on the results from glmmPQL(MASS)

2008-12-06 Thread zhijie zhang
0.963249 1.590.11860.05 -0.40543.4656 -2.42E-6 -- With Kind Regards, oooO: (..): :\.(:::Oooo:: ::\_)::(..):: :::)./::: ::(_/ : [***] ZhiJie Zhang ,PhD Dept.of

[R] Needs suggestions for choosing appropriate R packages

2008-11-26 Thread zhijie zhang
specified in X1 as above, Which package/functions is possible? Thanks a lot. -- With Kind Regards, oooO: (..): :\.(:::Oooo:: ::\_)::(..):: :::)./::: ::(_/ : [***] ZhiJie Zhang ,PhD Dept.of

[R] Generating series of distributions with the same skewness and different kurtosis or with same kurtosis and different skewness?

2008-09-23 Thread zhijie zhang
Dear R users, I hope to explain the concepts of skewness and kurtosis by generating series of distributions with same skewness and different kurtosis or with same kurtosis and different skewness, but it seems that i cannot find the right functions. I have searched the mailing list, but no

Re: [R] Generating series of distributions with the same skewness and different kurtosis or with same kurtosis and different skewness?

2008-09-23 Thread zhijie zhang
Xie [EMAIL PROTECTED] Phone: +86-(0)10-82509086 Fax: +86-(0)10-82509086 Mobile: +86-15810805877 Homepage: http://www.yihui.name School of Statistics, Room 1037, Mingde Main Building, Renmin University of China, Beijing, 100872, China On Tue, Sep 23, 2008 at 10:59 PM, zhijie zhang [EMAIL

[R] High resolution figures for a paper?

2008-06-02 Thread zhijie zhang
Dear Rusers, My manuscript has been conditionally accepted recently. The problem to generate the high resolution figures in R for the manuscript cannot be solved by me. The journal editor ask me to generate the figures with a minimum resolution of 500 dpi. I have tried the *menu-driven method*

Re: [R] High resolution figures for a paper?

2008-06-02 Thread zhijie zhang
://stat.ethz.ch/pipermail/r-sig-ecology/2008-May/thread.html and the thread is very near the bottom. Very detailed recommendations have been provided. (Also see the past two days, which are not of course in the May archive.) Sarah On Mon, Jun 2, 2008 at 11:12 AM, zhijie zhang [EMAIL PROTECTED

[R] What is the correct model formula for the results of piecewise linear function?

2008-03-24 Thread zhijie zhang
Dear friends, I used the B-spline (degree=1) method to fit the piecewise linear function and the results are listed below. m.glm-glm(mark~x+poly(elevation,2)+bs(distance,degree=1,knots=c(16.13,24)) +bs(y,degree=1,knots=c(-0.4357,-0.3202 )),family=binomial(logit),data=point)

Re: [R] Great difference for piecewise linear function between R and SAS

2008-03-24 Thread zhijie zhang
some materials? Thanks a lot. On 3/24/08, Duncan Murdoch [EMAIL PROTECTED] wrote: On 24/03/2008 5:23 AM, zhijie zhang wrote: Dear Rusers, I am now using R and SAS to fit the piecewise linear functions, and what surprised me is that they have a great differrent result. See below

Re: [R] Specify a correct formula in R for Piecewise Linear Functions?

2008-01-02 Thread zhijie zhang
*example*( pmin ) is useful. I will use it from now on. Thanks a lot. On Jan 3, 2008 2:50 AM, Charles C. Berry [EMAIL PROTECTED] wrote: On Thu, 3 Jan 2008, zhijie zhang wrote: Some developments with confusions. I tried the spline method and dummy variable approach to do

Re: [R] help on ROC analysis

2008-01-01 Thread zhijie zhang
Thanks. library(ROCR) was used finally. It also automatically generate a plot beside the value of AUC. On Dec 31, 2007 11:38 PM, Frank E Harrell Jr [EMAIL PROTECTED] wrote: zhijie zhang wrote: Dear all, Some functions like 'ROC(Epi)' can be used to perform ROC analyssi, but it needs us

[R] Specify a correct formula in R for Piecewise Linear Functions?

2008-01-01 Thread zhijie zhang
Dear all, I have two variables, y and x. It seems that the relationship between them is Piecewise Linear Functions. The cutpoint is 20. That is, when x20, there is a linear relationship between y and x; while x=20, there is another different linear relationship between them. How can i specify

[R] help on ROC analysis

2007-12-31 Thread zhijie zhang
Dear all, Some functions like 'ROC(Epi)' can be used to perform ROC analyssi, but it needs us to specify the fitting model in the argument. Now i have got the predicted p-values (0,1) for the 0/1 response variable using some other approach, see the following example dataset: id mark

Re: [R] Two repeated warnings when runing gam(mgcv) to analyze my dataset?

2007-12-17 Thread zhijie zhang
, zhijie zhang wrote: Dear all, I run the GAMs (generalized additive models) in gam(mgcv) using the following codes. m.gam -gam(mark~s(x)+s(y)+s(lstday2004)+s(ndvi2004)+s(slope)+s(elevation)+disbin ary,family=binomial(logit),data=point) And two repeated warnings appeared

[R] Two repeated warnings when runing gam(mgcv) to analyze my dataset?

2007-12-13 Thread zhijie zhang
Dear all, I run the GAMs (generalized additive models) in gam(mgcv) using the following codes. m.gam -gam(mark~s(x)+s(y)+s(lstday2004)+s(ndvi2004)+s(slope)+s(elevation)+disbinary,family=binomial(logit),data=point) And two repeated warnings appeared. Warnings: 1: In gam.fit(G, family =

[R] Hep on using GAM() in R

2007-12-12 Thread zhijie zhang
Dear friends, I met some problem on using GAM() function in R. Any help or suggestions are greatly appreciated. # My programs and problems are list below# library(splines) library(gam) point-read.csv(d:/gam.csv,sep=,,header=TRUE) #read the data

[R] Probelms on using gam(mgcv)

2007-12-12 Thread zhijie zhang
Dear all, Following the help from gam(mgcv) help page, i tried to analyze my dataset with all the default arguments. Unfortunately, it can't be run successfully. I list the errors below.

[R] question on image() function?

2007-11-08 Thread zhijie zhang
Dear friends, My dataset is like the following: xy mcpvalue 0.4603578 0.6247629 1.001 0.4603715 0.62477881.001 0.4603852 0.6247948 1.001 0.4110561 0.5664841 0.995 The x and y variables are unsorted. I use the

[R] Anybody has ever met the problem to add a legend to a figure generated by image()?

2007-10-12 Thread zhijie zhang
Dear friends, Anybody has ever met the problem to add a legend to a figure generated by image()? I have three variables,x,y and z. x and y are the coordinates, and z is the third values. we can use image(x, y, z,...) to generate a figure according to the z-values, but the problem is the figure

[R] How to add legend for image()?

2007-10-02 Thread zhijie zhang
Dear friends, The following is an example to explain my question. I want to get a legend which will show the z-values according to different colors in image() function. x-sort(runif(10)) #x-coordinates y-sort(runif(10)) #y-coordinates z-matrix(runif(100),nrow=10) #attributes values

[R] return(x=x,y=y,prob=prob) hasn't been used in R now?

2007-09-23 Thread zhijie zhang
Dear friends, Now, when i use the argument return(x=x,y=y,prob=prob) , R displays the waring message: Warning message: The return value for multiple variables wasn't used in: return(x = x, y = gy, prob = prob) I used the methods of help.search(return) and ?return to get some help, but didn't

Re: [R] return(x=x,y=y,prob=prob) hasn't been used in R now?

2007-09-23 Thread zhijie zhang
It works well. Thanks a lot. On 9/23/07, Christian Ritz [EMAIL PROTECTED] wrote: Hi! Use a list structure for all the components you want to have returned by the function: return(list(x=x, y=y, prob=prob)) Christian -- With Kind Regards, oooO: (..):

Re: [R] return(x=x,y=y,prob=prob) hasn't been used in R now?

2007-09-23 Thread zhijie zhang
2007, Peter Dalgaard wrote: zhijie zhang wrote: Dear friends, Now, when i use the argument return(x=x,y=y,prob=prob) , R displays the waring message: Warning message: The return value for multiple variables wasn't used in: return(x = x, y = gy, prob = prob) I used the methods

[R] What's the corresponding function in R for lo() function in S-PLUS?

2007-09-17 Thread zhijie zhang
Dear friends, In S-PLUS, we can use the following argument, but not in R. mode12 - gam(score1 ~ lo(latitude) + lo(longitude)) I searched the help in S-PLUS, it says lo() Allows the user to specify a Loess fit in a GAM formula, but i didn't find the correponding function in R. Anybody knows how

[R] Calculate the angles for a point dataset?

2007-09-13 Thread zhijie zhang
Dear Rusers, I'd like to take the cases of cancer of the larynx in chorley(spatstat) to explain my question. I want to join the points of cancer of the larynx with the disused industrial incinerator to generate lines, and then calculate the angles of these line comparing the horizontal line?