[R] How can i inhibit this work "Please select a CRAN mirror for use in this session "?

2007-08-25 Thread zhijie zhang
Dear Rusers, When i start R, there always the following work to do first, how should i cancel it? *--- Please select a CRAN mirror for use in this session ---* I don't know why it does so, maybe i have done something unintentionally. Thanks. -- With Kind Regards, oooO: (..)

[R] Is there any good tools to facilitate us to create R functions?

2007-08-17 Thread zhijie zhang
Dear R users, We have some programs for the specific task in our research, but they were very commonly used. We want to make some functions for them, anybody can recommend any good tools to facilitate us to create R functions even without going deep into the theories of R functions ? Any sugges

Re: [R] Can I test if there are statistical significance between different rows in R*C table?

2007-07-21 Thread zhijie zhang
AIL PROTECTED]> wrote: > > > > zhijie zhang wrote: > > Dear friends, > > My R*C table is as follow: > > > > > > > > better > > > > good > > > > bad > > > > Goup1 > > > > 16 > > > > 71 >

[R] Can I test if there are statistical significance between different rows in R*C table?

2007-07-19 Thread zhijie zhang
Dear friends, My R*C table is as follow: better good bad Goup1 16 71 37 Group2 0 4 61 Group3 1 6 57 Can I test if there are statistical significant between Group1 and Group2, Group2 and Group3, Group1 and Group2, taking into the multiple comparisons? The table can be set up

[R] a little problem on selecting a subset from dataset A according to dataset B?

2007-07-09 Thread zhijie zhang
Dear Friends, I want to extract the records from A according to B, but the results are not correct because R says : The length of long object is not integer times on the length of short object. Anybody have met the same problem? How to do it correctly? length(A)=47 length(B)=6 A[A$coords.x

[R] help on fisher.test(stats)?

2007-07-09 Thread zhijie zhang
Dear friends, My dataset have many zeros, so i must use fisher exact test . Unfortunately, the fisher.test(stats) function fail to do it. Anybody knows how to do the fisher exact test with many zeros in the dataset? My dataset is: a<-matrix(c(0,1,0,0,0,0,1,0,1,0,0,0,0,1,0,1,1,0,2,1,5,1,1,6,4,4,

[R] How should i get the quantile 2.5 % and 97.5% in each row of a matrix?

2007-06-01 Thread zhijie zhang
Dear friends, I need the get the 2.5% and 97.5% quantile from each row of a matrix, how should i get it? BTW, i can get the min/max value from each row of a matrix, using the following programs, is there an easy function to do it? simmin<-matrix(NA,nrow=47,ncol=1) for (i in 1:47) { simmin[

[R] R and S-Plus got the different results of principal component analysis from SAS, why?

2007-01-30 Thread zhijie zhang
Dear Rusers, I have met a difficult problem on explaining the differences of principal component analysis(PCA) between R,S-PLUS and SAS/STATA/SPSS, which wasn't met before. Althought they have got the same eigenvalues, their coeffiecients were different. First, I list my results from R,S-P

[R] Is it the PPS samples i needed in R?

2007-01-12 Thread zhijie zhang
Dear friends, I want to do a unequal probability sampling, that is, Probability Proportionate to size, Is it right for the following programs? Say my original dataset is: ID Population 1 100 2 200 3 300 IF the population is large ,then the corresponding ID has the large Probabi

[R] errors when setting up R2.4.0-win32.exe

2006-12-06 Thread zhijie zhang
Dear Ruser, Today, i download R2.4.0-win32.exe, but can't set it up successfully. The error informaiton is : *"0x38e4"memory quoted by "ox6c7f22b3" can't be "readonly".* My operating system in WindowXP. Where goes wrong? Thanks. -- With Kind Regards, oooO: (..): :\.(:::Ooo

[R] questions on adding reference line?

2006-11-18 Thread zhijie zhang
Dear Ruser, I use abline() function to add the reference line successfully, but i can't display the values corresponding to the reference line on the x/y axis, anybody knows how to display it? *My simulated programs:* y<-rnorm(50) plot(x,y) abline(v=0.5) *#my question is how to display x=0.5 i

Re: [R] plot questions?-errors in persp(x1, x2, y) and contour(x1, x2, y)

2006-11-07 Thread zhijie zhang
anks again. On 11/7/06, Uwe Ligges <[EMAIL PROTECTED]> wrote: > > > > zhijie zhang wrote: > > Dear Rusers, > > I want to know which function in R can perform the following tasks: > > 1.surface-data grid(x,y,z) #which could be done in splus, the name was > from &g

[R] plot questions?

2006-11-06 Thread zhijie zhang
Dear Rusers, I want to know which function in R can perform the following tasks: 1.surface-data grid(x,y,z) #which could be done in splus, the name was from splus's options of graph 2. contourplot(x,y,z) #which could be done in splus By the way, where can i find some useful materials to lear

[R] plots questions?

2006-11-06 Thread zhijie zhang
Dear friends, I have three variables ,x,y and z, and i want to get two plots: 1.three-dimensionel plot: z is the vertical axis, x and y is on the same horizontal plane; 2.contour plot:x is the horizontal axis, and y is vertical axis, and z is used to plot the contour line. I can't finish it ,a

[R] How to find further informations on specific options?

2006-10-31 Thread zhijie zhang
Dear friends, When i read the R-help , i often find the following case: e.g.:surf.gls(np, covmod, x, y, z, nx = 1000, ...) #Package Spatial: Arguments: covmod: function to evaluate covariance or correlation function * ...: parameters for 'covmod'* How should i find the further inform

[R] gamma distribution don't allow negative value in GLMs?

2006-10-15 Thread zhijie zhang
Dear friends, when i use glm() to fit my data, i use glm(formula = snail ~ vegtype + mhveg + humidity + elevation + soiltem, *family = Gamma(link = inverse),* data =a,)) It shows: error in eval(expr, envir, enclos) : *gamma distribution don't allow negative value*. But i use result<-glm(formula

Re: [R] sort question in a dataset?

2006-10-14 Thread zhijie zhang
*Richard M. Heiberger* , You have showed a detailed informaton on order, but it seems that there's a little difference between my task and your suggestions. I'd like to give a clear example to show my task: x <- c(2, 9, 18, 3, 2) y <- c(2,9,8,9,8) z <- c(21,5,5,19,7) a <- cbind(x, y, z) #dat

[R] sort question in a dataset?

2006-10-14 Thread zhijie zhang
Dear friends, I want to sort a dataset according to one or two variables in the dataset, i thought sort could do it , but failed. e.g. x <- c(2, 9, 18, 3, 2) y<-c(2,5.6,5,9,8) z<-c(21,5,5,19,7) a<-cbind(x,y,z) a x y z [1,] 2 2.0 21 [2,] 9 5.6 5 [3,] 18 5.0 5 [4,] 3 9.0 19 [5,] 2 8

[R] Is there a function in R to evaluate the adjusted AIC or other statistc where overdispersion existed in GLMs?

2006-10-12 Thread zhijie zhang
Dear friends, As we all know, the usual model selection criteria(e.g.deviance,AIC...) in GLMs isn't very good for selecting the best model when overdispersion exist, so we need to adjust the corresponding statistic,see(Fitzmaurice,G.M. (1997) Model selection with overdispersed data, The Statisti

Re: [R] how to get the variance-covariance matrix/information of alpha and beta after fitting a GLMs?

2006-10-12 Thread zhijie zhang
Dear friends, Both vcov(your.model) and summary(B)$cov.unscaled,summary(B)$cov.scaled works, and vcov is the function that i'm looking for. Thanks very much! - with kind regards zhijie [[alternative HTML version deleted]] __ R-hel

[R] how to get the variance-covariance matrix/information of alpha and beta after fitting a GLMs?

2006-10-12 Thread zhijie zhang
Dear friends, After fitting a generalized linear models ,i hope to get the variance of alpha,variance of beta and their covariance, that is , the variance-covariance matrix/information of alpha and beta , suppose *B* is the object of GLMs, i use attributes(B) to look for the options ,but can't f

Re: [R] help on plots

2006-09-28 Thread zhijie zhang
*Marc Schwartz ,* ** Method2 is what i need, and they are good answers. A little more question is how to add the legend to the plot? legend() may do it,but i fail to add them. Thanks again. with kind regards zhijie zhang On 9/29/06, Marc Schwartz (via MN) <[EM

[R] help on plots

2006-09-28 Thread zhijie zhang
Dear friends, I met a problem on plotting. My dataset is : yearMHBC LHBC MHRC LURC 1993 11.75 4.50 0.43 0.46 19947.25 1.25 0.35 0.51 19958.67 2.17 0.54 0.44 1996 2.67 1.33 0.78 0.47 1997 3.42 4.92 0.69 0.48 1998 1.92 3.08 0.72 0.54 1999 2.3

Re: [R] what's wrong with my simulation programs on logistic regression

2006-08-31 Thread zhijie zhang
seems different between them(or it's also wrong for my simulated linear model),i'm not very clear about them,thanks for a little more explanations on them. On 8/31/06, Prof Brian Ripley <[EMAIL PROTECTED]> wrote: > > On Thu, 31 Aug 2006, zhijie zhang wrote: > > > Dear fr

Re: [R] what's wrong with my simulation programs on logistic regression

2006-08-31 Thread zhijie zhang
+x2+x3+x4+x5+x6+x7+x8, Thanks very much! On 8/31/06, zhijie zhang <[EMAIL PROTECTED]> wrote: > > Dear friends, > I'm doing a simulation on logistic regression model, but the programs > can't work well,please help me to correct it and give some suggestions. > My

[R] what's wrong with my simulation programs on logistic regression

2006-08-31 Thread zhijie zhang
Dear friends, I'm doing a simulation on logistic regression model, but the programs can't work well,please help me to correct it and give some suggestions. My programs: data<-matrix(rnorm(400),ncol=8) #sample size is 50 data<-data.frame(data) names(data)<-c(paste("x",1:8,sep="")) #8 independent

[R] how to complete this task on data management

2006-08-22 Thread zhijie zhang
Dear friends, When i clean my dataset , i met a difficulty suppose my data set is : *> data<-data.frame(x=c(1:5,1,2,3)) > data x 1 1 2 2 3 3 4 4 5 5* 6 1 7 2 8 3 Now i need to add the data which are less than 3.5 at the bottom, not including the top data, so the results should be : x 1 1 2 2

[R] fit the series data

2006-08-20 Thread zhijie zhang
Dear friends, suppose my dataset *xy* : xy 1 5 2 3 5 6 6 8 -generated the data-- x<-c(1,2,5,6) y<-c(5,3,6,8) xy<-data.frame(x,y) --- I want to fit the gap in x with the corresponding y=0, I use the following programs to generate

[R] how to the p-values or t-values from the lm's results

2006-08-19 Thread zhijie zhang
Dear friends, After running the lm() model, we can get summary resluts like the following: Coefficients: Estimate Std. Error t value Pr(>|t|) x1 0.115620.10994 1.052 0.2957 x2 -0.138790.09674 -1.435 0.1548 x3 0.010510.09862 0.107 0.9153 x4 0.141830.08471 1.674

[R] how to link matrix with the variables

2006-08-09 Thread zhijie zhang
Dear friends, Suppose the correlation matrix of x1-x3 is as follows: x1 x2 x3 x1 1 x2 0.51 x3 0.6 0.41 1.First, to generate the matrix of x1-x3 in R; 2.to get the random number: x1<-rnorm(10), is it enough to generate only the x1-values? Do i need to generate x2 and x3? 3

[R] how to generate this simulation dataset in R

2006-08-06 Thread zhijie zhang
Dear Rusers, I want to compare the different methods of variable selction in linear/logistic regression, so i want to generate simulated datasets, how to do that? e.g. response variable:y independent variables:x1-x4 residual item:e the theoretical formula is: y=2.1+0.1*x1+0.2*x2 x3,x4 are not re

[R] how to use the EV AND condEV from BMA's results?

2006-08-03 Thread zhijie zhang
Dear friends, In R, the help of "bic.glm" tells the difference between postmean(the posterior mean of each coefficient from model averaging) and condpostmean(the posterior mean of each coefficient conditional on the variable being included in the model), But it's still unclear about the results exp

[R] questions on aggregate data

2006-08-02 Thread zhijie zhang
Dear friends, my question is how to aggregate dataset and the inverse manipulation. e.g.My dataset data structure1: x 1 1 2 3 3 data structure2: x freq 1 2 2 1 3 2 Then how to generate dataset2 from dataset1 and generate dataset1 from dataset2? e.g. dataset2 from dataset1 : x<-c(1,1,2,3,3)

[R] help on fitting negative binomial distribution with MLE

2006-08-01 Thread zhijie zhang
Dear friends, Anybody knows how to fit the negative binomial distribution with MLE using R or other software? I can't find the solution, any suggestions or help would be greatly appreciated. -- Kind Regards, Zhi Jie,Zhang [[alternative HTML version deleted]] _

[R] set the bahavior that R deal with missing values?

2006-07-13 Thread zhijie zhang
Dear Rusers, The default behavior in R when performing a regression model with missing values is to exclude any case that contains a missing value? How could i set the bahavior that R deal with missing values? e.g.: exclude cases listwise exclude cases pairwise replace with mean Thanks very much!

[R] set the bahavior that R deal with missing values?

2006-07-13 Thread zhijie zhang
Dear Rusers, The default behavior in R when performing a regression model with missing values is to exclude any case that contains a missing value? How could i set the bahavior that R deal with missing values? e.g.: exclude cases listwise exclude cases pairwise replace with mean Thanks very much!

[R] which model (GLMs)is the best?

2006-07-08 Thread zhijie zhang
Dear friends, I used R to analyze my data with the models of generalized linear models, and found three models were relatively good, but i can't decide which is the best,how should i do ? *Model1:* glm(formula = snail ~ grass + gheight + humidity + altitude + soiltem + airtem + grass:altitude, *

[R] how to name a variable?

2006-07-07 Thread zhijie zhang
Dear friends, The "s" in the following argument don't have a variable name, how should i give it a name? > s<-data.frame(seq(1,6,by=2)) > s seq.1..6..by...2. 1 1 2 3 3 5 thanks very much! -- Kind Regards, Zhi Jie,Zhang ,PHD Department of Epidem

[R] questions on data management

2006-07-05 Thread zhijie zhang
Dear friends, suppose i have two datasets: A and B A: id<-1:6 x<-c(1,2,3,4,5,6) y<-c(2,4,6,8,3,2) xy<-data.frame(id,x,y) B m<-c(1,1,3,3,5,5) n<-c(2,2,6,6,3,3) mn<-data.frame(m,n) Now, i want to perfomr two tasks: 1. get a subset of B,no duplicate values,: C: m n 1 2 3 6 5 3 2.Extract the values

[R] who can explain the difference between the R and SAS on the results of GLM

2006-07-04 Thread zhijie zhang
Dear friends, I used R and SAS to analyze my data through generalized linear model, and there is some difference between them. Results from R: glm(formula = snail ~ grass + gheight + humidity + altitude + soiltemr + airtemr, family = Gamma) Deviance Residuals: Min1QMedian

[R] how do we sample in spatial statistics?

2006-07-04 Thread zhijie zhang
Dear friends, -- Kind Regards, Zhi Jie,Zhang ,PHD Department of Epidemiology School of Public Health Fudan University Tel:86-21-54237149 [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailma

[R] random sampling problems?

2006-07-04 Thread zhijie zhang
Dear friends, suppose my dataset is the following data: id<-1:9 x<-c(1,2,3,1,2,3,1,2,3) y<-c(1,1,1,2,2,2,3,3,3) data<-data.frame(id,x,y) id x y 1 1 1 1 2 2 2 1 3 3 3 1 4 4 1 2 5 5 2 2 6 6 3 2 7 7 1 3 8 8 2 3 9 9 3 3 i want to do sampling like

[R] do i set the correct argument?

2006-07-03 Thread zhijie zhang
Dear friends, In gls() of nlme package, there is some explanation on correlation: gls(model, data, correlation, weights, subset, method, na.action, control, verbose) correlation: an optional 'corStruct' object describing the within-group correlation structure. See the documentation of

[R] could i change the ouput style on summary?

2006-07-03 Thread zhijie zhang
Dear friends, summary() doesn't give a good ouput style,e.g.: grasssoiltem airtem gheight humidity altitude diluo :38 Min. :15.90 Min. :17.70 Min. : 8.00 Min. : 0.2360 high: 43 huanghuacai:32 1st Qu.:19.32 1st Qu.:22.60 1st Qu.:40.00

[R] how to get the studentized residuals in lm()

2006-07-02 Thread zhijie zhang
Dear friends, In s-plus, lm() generates the the studentized residuals automatically for us, and In R, it seems don't have the results: After i fitted lm(), i use attibutes() to see the objects and didn't find studentized residuals . How to get the the studentized residuals in lm(),have i missed

[R] how to recode in my dataset?

2006-07-02 Thread zhijie zhang
Dear Rusers, My question is about "recode variables". First, i'd like to say something about the idea of recoding: My dataset have three variables:type,soiltem and airtem,which means grass type, soil temperature and air temperature. As we all known, the change of air temperature is greater than s

[R] replace values?

2006-07-01 Thread zhijie zhang
Dear friends, i have a dataset like this: x y z 1 2 3 2 3 1 3 2 1 1 1 3 2 1 2 3 2 3 2 1 1 I want to replace x with the following values:1<-a,2<-b,3<-c,4<-d; replace y with the following values:1<-b,2<-a,3<-c,4<-d; replace z with the following values:1<-d,2<-c,3<-b,4<-a;

[R] general linear model and generalized linear model

2006-06-30 Thread zhijie zhang
Dear friends, I searched the R site and found a lot of results on general linear model and generalized linear model , and i was confused by them. Here, I only want to get some concise answers on the following questions and i'll study it by your hints: 1. Which function(package) could be used to

[R] A question related with resale()

2006-06-21 Thread zhijie zhang
Dearfriends, A question related with resale(). I have a dataset *a* with three variables *x,y,id* I want to do two different things: 1. rescale the combination of x and y into the new range --unit square(0,1),that is, keep the shape of original plot; 2.rescale x and y into the new range (0,1)

[R] how to finish my task?

2006-06-20 Thread zhijie zhang
Dearfriends, A question related with resale(). I have a dataset *a* with three variables *x,y,id* I want to do two different things: 1. rescale the combination of x and y into the new range (0,1),that is, keep the shape of original plot; 2.rescale x and y into the new range (0,1) respectively,

[R] rescale the data into unit square?

2006-06-20 Thread zhijie zhang
Dear Rusers, Recently, i saw the sentence "rescale the data into unit square" for several times. Could anybody tell me what it means,and give an example? Thanks very much! -- Kind Regards, Zhi Jie,Zhang , [[alternative HTML version deleted]] ___

[R] how to put the results of loop into a dataframe

2006-06-19 Thread zhijie zhang
Dear friends, suppose i want to do the following caulation for 100 times, how to put the results of x , y and z into the same dataframe/dataset? x<-runif(1) y<-x+1 z<-x+y thanks in advance! -- Kind Regards, Zhi Jie,Zhang ,PHD Department of Epidemiology School of Public Health Fudan University

[R] how to put the results of loop into a dataframe

2006-06-19 Thread zhijie zhang
Dear friends, suppose i want to do the following caulation for 100 times, how to put the results of x , y and z into the same dataframe/dataset? x<-runif(1) y<-x+1 z<-x+y thanks in advance! -- Kind Regards, Zhi Jie,Zhang ,PHD Department of Epidemiology School of Public Health Fudan University Te

[R] how to analyze the following data?--anxious for the result

2006-06-07 Thread zhijie zhang
Dear friends, I have a dataset: response var--y, class var-group, and the third variable-x. I want to test whether there is statistical significance bewteen group for y with the controlled x. First, i want to use analysis of covariance in SAS, but i found that y isn't noramal and can't become nor

[R] how to do multiple comparison in the nonparametric statistical analysis?

2006-06-07 Thread zhijie zhang
Dear Rusers, As we all know , there are many methods to do multiple comparison in the parametric statistical analysis, But i can't find some in nonparametric statistical analysis. Could anybody give some suggestions? [[alternative HTML version deleted]] _

[R] a question on subset a dataset

2006-04-13 Thread zhijie zhang
Dear R-users, I generate a dataset "d", and want to get a subset from it. ** *z<-rnorm(9) coords<-cbind(x=c(1,1,1,2,2,2,3,3,3),y=c(1,2,3,1,2,3,1,2,3)) d<-SpatialPointsDataFrame(coords, data.frame (z=z[1:9]))* The result*/dataset* is coordinates z 1 (1, 1) 1.41173570 2 (1, 2)

[R] subset a matrix

2006-04-12 Thread zhijie zhang
Dear friends, I have a (20*30) matrix,and want to get a subset of it like the following: The original matrix: rows:1,2,3,20; columns:1,2,3,30 I want to get my subset of The original matrix and delete others: rows:1,3,5,7,...19; columns:1,3,5.29 -- Kind Regards,Zhi Jie,Zhang

[R] Is there any method to compare Moran's I between different populations?

2006-04-04 Thread zhijie zhang
Is there any method to compare Moran's I between different populations? As we know, in classical statistics ,there are ttest,Anova,...which can be used to compare means in different populations,so we can make a decision whether their means are different or not. But spatial statistics seems not to

[R] who can tell me the reason why it is different on calculating Moran's I using ARCGIS, Geoda and R?

2006-03-23 Thread zhijie zhang
The attachment is my dataset: 1.ccc.shp (the original data) 2.ccc.gwt, which is computed by Geoda; Introduction to the variables in my data: ID: key variable; N_LATITUDE: latitude measured by GPS; E_LONGITUD: longitude measured by GPS; LIVES: attribute data I get the different result of Moran

[R] data management on R

2006-03-23 Thread zhijie zhang
Dear friends, i have two dataset: A and B A: x y 1 2 3 4 B: m n 1 2 7 8 How to generate datasetC: C: x n 1 2 3 8 i know sas can do it easily, what about R? -- Kind Regards, __ R-help@stat.math.ethz.ch mailing list https://stat.ethz

[R] still unclear about the parameters of Moran's I

2006-03-23 Thread zhijie zhang
I have read the introductions on Moran of SPDEP package, but still unclear about the parameters of Moran's I, and can't calculate the Moran's I. For example,I have a dataset like the following(only an example): longitude latitudex 110.23 32.53 10 109.52 33.2120

[R] How to join "specific Special Interest Group (=: SIG) mailing lists"

2006-03-21 Thread zhijie zhang
there are several specific Special Interest Group (=: SIG) mailing lists,and i'm interested in the"R-sig-Geo :R Special Interest Group on using Geographical data and Mapping ",but can't find how to join it, could anybody tell me how to do that? thank u very much! -- Kind Regards,Zhi Jie,Zhang ,

[R] help on moran's I index of point pattern, not areal pattern

2006-03-14 Thread zhijie zhang
hi,friends, we all know that moran's I index and Geary'C index can be used to test spatial autocorrelation in both the area data and point data, but i only can find something on how to calculate on the data of area, and can't find the methods to perform it on the point data, could anybody give me