[R] Questions about ks.test function {stats}

2024-04-08 Thread Jin, Ziyan
Dear R-help, Hope this email finds you well. My name is Ziyan. I am a graduate student in Zhejiang University. My subject research involves ks.test in stats-package {stats}. Based on the code, I have two main questions. Could you provide me some more information? I download different versions

Re: [R] running crossvalidation many times MSE for Lasso regression

2023-10-23 Thread Jin Li
resulted from the methods themselves. Anyway, people interested can use their own data to test and see. Best, Jin On Tue, Oct 24, 2023 at 4:59 AM Ben Bolker wrote: >For what it's worth it looks like spm2 is specifically for *spatial* > predictive modeling; presumably its version of

Re: [R] running crossvalidation many times MSE for Lasso regression

2023-10-22 Thread Jin Li
list -- To UNSUBSCRIBE and more, see > >> https://stat.ethz.ch/mailman/listinfo/r-help > >> PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > >> and provide commented, minimal, self-contained, reproducible

Re: [R] Sensitivity and Specificity

2022-10-24 Thread Jin Li
Hi Greg, This can be done by: spm::pred.acc(testing$case, predict_testing) It will return both sensitivity and specificity, along with a few other commonly used measures. Hope this helps, Jin On Tue, Oct 25, 2022 at 6:01 AM Rui Barradas wrote: > Às 16:50 de 24/10/2022, greg holly escre

Re: [R] How important is set.seed

2022-03-21 Thread Jin Li
Predictive Modeling with R (doi:10.1201/9781003091776), where many reproducible examples are provided for various predictive methods including RF, GBM and SVM. Hope this helps. Jin On Tue, Mar 22, 2022 at 11:51 AM Ebert,Timothy Aaron wrote: > If you are using the program for data analysis t

[R] Release of a new package steprf: Stepwise Predictive Variable Selection for Random Forest

2021-11-14 Thread Jin Li
references cited in the description of the package. Cheers, -- Jin -- Jin Li, PhD Founder, Data2action, Australia https://www.researchgate.net/profile/Jin_Li32 https://scholar.google.com/citations?user=Jeot53EJ&hl=en [[alternative HTML version del

[R] spm2: A new package for (spatial) predictive modelling

2021-10-17 Thread Jin Li
s for data preparation and predictive accuracy assessment. Any feedback is welcome and appreciated. -- Jin ------ Jin Li, PhD Founder, Data2action, Australia https://www.researchgate.net/profile/Jin_Li32 https://scholar.google.com/citations?user=Jeot53EA

[R] Spm package is updated and available on CRAN again

2021-09-07 Thread Jin Li
free to contact me if you have any questions regarding the spm package. Best regards, -- Jin [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help

[R] spm package is available on CRAN again

2021-09-06 Thread Jin Li
to contact me if you have any questions regarding the spm package. Best regards, -- Jin -- Jin Li, PhD Founder, Data2action, Australia https://www.researchgate.net/profile/Jin_Li32 https://scholar.google.com/citations?user=Jeot53EJ&h

Re: [R] How to make our data normally distributed in R

2020-03-15 Thread Jin Li
: > Thanks a lot Jin.. > > If my total number of observations are 500, > n will be 500, > mu will be average (500) > s will be sd (500) > and m will be RMSE value i.e. 4500 in this case? > > tovecv(n=500, mu=average (500), s=sd, m=4500, measure="rmse") > > >

Re: [R] How to make our data normally distributed in R

2020-03-12 Thread Jin Li
VEcv using tovecv in spm. Hope this helps, Jin On Fri, Mar 13, 2020 at 8:08 AM Neha gupta wrote: > Hi > > I have a regression based data where I get the RMSE results as: > > SVM=3500 > ANN=4600 > R.Forest=2900 > > I want to know how can I make it so that its values

[R] A new version (1.2.0) of the “spm” package for spatial predictive modelling is now on CRAN. [SEC=UNCLASSIFIED]

2019-02-24 Thread Li Jin
suggestions, please send me an email! Thanks in advance! Kind regards, Jin Li, PhD | Spatial Modeller / Computational Statistician National Earth and Marine Observations | Environmental Geoscience Division t: +61 2 6249 9899www.ga.gov.au<http://www.ga.gov.au/> Geoscience Australia Disc

[R] xgboost: problems with predictions for count data [SEC=UNCLASSIFIED]

2018-04-02 Thread Li Jin
sysname release "Windows" "7 x64" version "build 7601, Service Pack 1" machine "x86-64" Have I miss-specified or missed some param

[R] A new version (1.1.0) of the “spm” package for spatial predictive modelling reelased on CRAN [SEC=UNCLASSIFIED]

2018-03-21 Thread Li Jin
. Revised RFcv etc. to use pred.acc. 6. Removed samples with missing values in data(hard). 6. Updated vignette accordingly. Comments, suggestions and contributions are welcome and much appreciated!. Kind regards, Jin Li, PhD | Spatial Modeller / Computational Statistician National Earth and

[R] FW: Predictive accuracy measures in a recently released R package, spm: Spatial Predictive Modelling [SEC=UNCLASSIFIED]

2017-08-29 Thread Li Jin
nor r2, why not? Then what? PLOS ONE 12 (8): e0183250. http://journals.plos.org/plosone/article?id=10.1371/journal.pone.0183250. The package, spm, can be downloaded from CRAN now.  Any feedback and comments are much appreciated! Kind regards, Jin Jin Li, PhD | Spatial Modeller / Computati

Re: [R] [DKIM] Batch Installer for R [SEC=UNCLASSIFIED]

2016-03-31 Thread Li Jin
_R3.1.0") for (p in setdiff(packages, installed.packages()[,"Package"])) install.packages(p) Hope this helps. Jin -Original Message- From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Tobias Knuth Sent: Friday, 1 April 2016 12:05 AM To: r-help@r-project.org Su

Re: [R] Package(s) for making waffle plot-like figures?

2013-11-03 Thread Zhao Jin
, too. Best regards, Zhao 2013/11/2 Jim Lemon > On 11/02/2013 10:35 AM, Zhao Jin wrote: > >> Dear all, >> >> I am trying to make a series of waffle plot-like figures for my data to >> visualize the ratios of amino acid residues at each position. For each one >>

[R] Package(s) for making waffle plot-like figures?

2013-11-01 Thread Zhao Jin
Dear all, I am trying to make a series of waffle plot-like figures for my data to visualize the ratios of amino acid residues at each position. For each one of 37 positions, there may be one to four different amino acid residues. So the data consist of the positions, what residues are there, and t

[R] Adding across columns ignoring NA

2013-07-19 Thread Jin Choi
I am having difficulty finding a solution to devising an R code to do the following: I have 5 numerical variables and I would like to create a new variable that is the sum of those 5 variables. However, there are many NA values throughout these 5 variables and everytime I run the following code n

Re: [R] vegan capscale 'subscript out of bounds' error

2013-07-15 Thread Zhao Jin
Dear Jari, Thanks a lot for your reply. Let me describe more about my dataset: it consists of count data for samples, and shows how many copies of a certain bacteria are in a sample. There are 92 samples (rows), and about 3500 kinds of bacteria (columns). Variable 1 (Var1) is a factor indicati

[R] vegan capscale 'subscript out of bounds' error

2013-07-12 Thread Zhao Jin
similarity matrix in the formula. Here is more info on the R version and the OS: R version 3.0.1 (2013-05-16) Platform: x86_64-w64-mingw32/x64 (64-bit) Thanks a lot for any help or comment, Zhao -- Zhao JIN Ph.D. Candidate Ruth Ley Lab 467 Biotech Field of Microbiology, Cornell University Lab: 607.25

[R] how to maximize the log-likelihood function with EM algorithm

2013-06-12 Thread Anhai Jin
Hi R users, I am trying to fit a Mixed Markov Model and ran into trouble with maximizing the log-likelihood function. I attached my R codes and the problem I have right now is that the maximization may end in some local maximum by specifying different start values. I am thinking if we can impro

[R] Package for maximizing likelihood function with EM algorithm

2013-06-11 Thread Anhai Jin
Hi R users, I am trying to figure out if there is a package in R that can maximize likelihood function with EM algorithm. Right now, I have derived the log-likelihood function, which is a function of 9 indicator variables with 14 parameters. Is there a package that I can specify the log-likelih

[R] FW: 3/13/2013 3:55:55 PM

2013-03-13 Thread Jin Minming
http://www.physioth.com/mkqrozh/njy 3/13/2013 3:55:55 PM . Jin Minming [[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

[R] Help calculating p-values

2013-02-01 Thread Jin Choi
I am trying to figure out how to calculate p-values for the difference in prevalence of a risk factor between men and women. For example, I find that 277 out of 710 male patients and 125 out of 305 female patients have obesity, what is the p-value for their difference? If there is a package that c

Re: [R] How to do the same thing for all levels of a column?

2012-07-24 Thread Zhao Jin
hn Kane > >>>> Kingston ON Canada > >>>> > >>>>> -Original Message- > >>>>> From: [2]z...@cornell.edu > >>>>> Sent: Mon, 23 Jul 2012 18:01:11 -0400 > >>>>> To: [3

Re: [R] How to do the same thing for all levels of a column?

2012-07-24 Thread Zhao Jin
; D > > > > A > > > > p2 > > > > 0.0002731 > > > > T > > > > E > > > > N > > > > L > > > > V > > > > P > > > > G > > > > A > > > > p3 > > > >

[R] How to do the same thing for all levels of a column?

2012-07-23 Thread Zhao Jin
Many thanks for any help you could give me on this topic! :) Regards, Zhao -- Zhao JIN Ph.D. Candidate Ruth Ley Lab 467 Biotech Field of Microbiology, Cornell University Lab: 607.255.4954 Cell: 412.889.3675 [[alternative HTML version deleted]] ___

[R] contingency tables in R

2012-07-22 Thread Jin Choi
sk factor. Then I could calculate the prevalence of each risk factor separately. This approach will take a very long time so I was hoping to ask if anyone knew of a solution to this issue I am having with contingency tables...perhaps a useful R package? Thank you for your help! Jin Choi Master

Re: [R] Is it possible to remove this loop? [SEC=UNCLASSIFIED]

2012-07-03 Thread Jin . Li
Thanks for your validation. Yes Peter's solution is the fastest, faster than the previous one by saving 25% time. It was missed out in my previous testing. Jin -Original Message- From: Pascal Oettli [mailto:kri...@ymail.com] Sent: Wednesday, 4 July 2012 2:07 PM To: Li Jin Cc: r-h

Re: [R] Is it possible to remove this loop? [SEC=UNCLASSIFIED]

2012-07-03 Thread Jin . Li
Thank you all for providing various alternatives. They are all pretty fast. Great help! Based on a test of a dataset with 800,000 rows, the time used varies from 0.04 to 11.56 s. The champion is: > a1$h2 <- 0 > a1$h2[a1$h1=="H"] <- 1 Regards, Jin Geoscience Australia D

[R] Is it possible to remove this loop? [SEC=UNCLASSIFIED]

2012-07-03 Thread Jin . Li
code to achieve the desired result? Thanks in advance, Jin Geoscience Australia Disclaimer: This e-mail (and files transmitted with it) is intended only for the person or entity to which it is addressed. If you are not the intended recipient, then you have received this e-mail by mistake and any

[R] Partial R-square in multiple linear regression

2012-06-01 Thread Jin Choi
indepenent variables. I tried searching for this function in many R packages, but it has proven elusive to me. I am an R beginner, and I am hoping that I will find a solution! Thank you very much. Sincerely, Jin Choi MSc Epidemiology student McGill University, Montreal, Queb

Re: [R] metafor

2012-05-07 Thread Jin Choi
very much to both of you! Jin On Mon, May 7, 2012 at 5:14 AM, Viechtbauer Wolfgang (STAT) wrote: > Michael just provided a good suggestion, using the subset argument to make > sure that you are really using the same data in both analyses. > > However, I would not expect the results t

[R] metafor

2012-05-05 Thread Jin Choi
ack-transforming to raw r after pooling. Thank you very much. Jin Choi MSc (Epidemiology) Student McGill University, Montreal CANADA __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http

[R] Retrieving matrix column and row names by index value

2012-03-29 Thread Lanna Jin
Hi all, So let's say I have a matrix, mdat and I only know the index number. How do I retrieve the column and row names? For example, > mdat <- matrix(c(1,2,3, 11,12,13), nrow = 2, ncol=3, byrow=TRUE, dimnames = list(c("row1", "row2"), c("C.1", "C.2"

[R] Sensitivity analysis in case of correlated inputs

2012-03-18 Thread Jin Minming
Dear All, There are two packages which can be used for sensitivtiy analysis when the predictor variables are correlated. a: pcc (partial correlation coefficient) in R sensitivity package b: varimp in R party package (conditional importance) Are other R packages available for sensitivity anlaysi

Re: [R] 632 estimator using boot package

2012-03-06 Thread Jin Minming
r-help@r-project.org > Date: Tuesday, 6 March, 2012, 3:23 > Jim if I understand you, you are > using the ordinary bootstrap instead of the > Efron-Gong "optimism bootstrap".  I don't think the > ordinary bootstrap is > applicable here. > Frank > > Jin Minm

Re: [R] 632 estimator using boot package

2012-03-05 Thread Jin Minming
p seem to be a > result only of the use of a discontinuous improper scoring > role (proportion > classified correctly).  The advantage may vanish when > better scoring rules > are used.  Simulations showing this may be found at > http://biostat.mc.vanderbilt.edu/rms > > Fran

Re: [R] 632 estimator using boot package

2012-03-05 Thread Jin Minming
="parametric" and supplying your own function > which takes the data and returns a bootstrap sample. > > Angelo Canty > > Jin Minming wrote: > > Dear All, > > > > Anyone has some idea how to implement 632 estimator and > leave-one out bootstraping method by

[R] 632 estimator using boot package

2012-03-05 Thread Jin Minming
Dear All, Anyone has some idea how to implement 632 estimator and leave-one out bootstraping method by using boot package. I know the bootstrap package has this function, but it sounds not very flexible for my project. Thanks, Jim __ R-help@r-proj

Re: [R] Fw: Variable selection based on both training and testing data

2012-01-30 Thread Jin Minming
[R] Fw: Variable selection based on both training and testing data > To: "r-help@r-project.org" > Date: Monday, 30 January, 2012, 14:57 > > > From: SR Millis > To: Jin Minming > > Sent: Monday, January 30, 2012 9:25 AM > Subject: Re: [R] Variable selectio

Re: [R] Variable selection based on both training and testing data

2012-01-30 Thread Jin Minming
ndy > Subject: RE: [R] Variable selection based on both training and testing data > To: "'Jin Minming'" , "r-help@r-project.org" > > Date: Monday, 30 January, 2012, 13:39 > Variable section is part of the > training process-- it chooses the model. 

[R] Variable selection based on both training and testing data

2012-01-30 Thread Jin Minming
Dear all, The variable selection in regression is usually determined by the training data using AIC or F value, such as stepAIC. Is there some R package that can consider both the training and test dataset? For example, I have two separate training data and test data. Firstly, a regression mode

Re: [R] Error from Brugs "'r for windows gui front-end has stopped working''

2012-01-29 Thread Jin Minming
ges > Subject: Re: [R] Error from Brugs "'r for windows gui front-end has stopped > working'' > To: "Jin Minming" > Cc: r-help@r-project.org > Date: Saturday, 28 January, 2012, 18:45 > > > On 25.01.2012 18:50, Jin Minming wrote: > > Hello U

Re: [R] Error from Brugs "'r for windows gui front-end has stopped working''

2012-01-25 Thread Jin Minming
indows gui front-end has stopped > working'' > To: "Jin Minming" > Cc: r-help@r-project.org > Date: Wednesday, 25 January, 2012, 11:09 > I just tried all 100 iterations both > under WinXP and Windows Server 2008 > of your script under 32-bit R (which I a

Re: [R] Error from Brugs "'r for windows gui front-end has stopped working''

2012-01-25 Thread Jin Minming
some plots #samplesHistory("*", mfrow = c(4, 2)) # plot the chain, #samplesDensity("alpha") # plot the densities, #samplesBgr("alpha[1:6]") # plot the bgr statistics, and #samplesAutoC("alpha[1:6]", 1)# plot autocorrelations of 1st

[R] Error from Brugs "'r for windows gui front-end has stopped working''

2012-01-24 Thread Jin Minming
Dear all, I just try to run the example in R brugs packages, but not only once. Loop is added in this example. After several times (7, 11, or other random number), there is an error message "r for windows gui front-end has stopped working". This happened in two laptops with windows 7 and vista.

[R] Inverse problems in R package

2011-12-24 Thread Jin Minming
Dear  all,   I have a general relationship, which can be easily solved using forward engineering model, y=f(x1, x2, x3) Now I know a distribution of y, how can I get the corresponding distributions for x1, x2, and x3? In another situation, if I know the distributions of y and x1, how can I ob

[R] optim with simulated annealing SANN for combinatorial optimization

2011-12-15 Thread Dae-Jin Lee
Hi all I am trying to solve a combinatorial optimization problem. Basically, I can reduce my problem into the next problem: 1.- Given a NxN grid of points, with some values in each cell 2.- Find the combination of K points on the grid such that, the maximum mean value is obtained I took the Tr

[R] adjusting levelplot color scale to data

2011-11-06 Thread Lanna Jin
Hi guys, I have a matrix with values varying from approximately -0.7 to 0.33 that I want to create a heatmap/levelplot with. When I execute the levelplot function for my matrix, I end up getting colors that are adjusted to the max and min rather than around 0. In other words, ideally I would like

Re: [R] Problems of metafile plots when converting word to pdf file

2011-09-13 Thread Jin Minming
To: "Jean-Christophe BOUËTTÉ" Cc: "Jin Minming" , r-help@r-project.org Date: Tuesday, 13 September, 2011, 14:02 Jim, I have seen this outcome as well with graphs from time to time and agree with Jean-Christophe that the bug seems to creep in at the Windows / Office level.  You

[R] Problems of metafile plots when converting word to pdf file

2011-09-13 Thread Jin Minming
Hi all, I copy metafile boxplot from R to Word. Then save as Pdf file. But I found there are some unexpected black lines in some plots within this PDF file. Please give me some advice how to get rid of these black lines in PDF files. Thanks a lot, Jim [[alternative HTML version delet

[R] Lasso for k-subset regression

2011-06-05 Thread Dae-Jin Lee
Dear R-users I'm trying to use lasso in lars package for subset regression, I have a large matrix of size 1000x100 and my aim is to select a subset k of the 100 variables. Is there any way in lars to fix the number k (i.e. to select the best 10 variables) library(lars) aa=lars(X,Y,type="lasso"

[R] about prediction with a factor

2011-02-10 Thread Zhao Jin
a prediction with new data like yd=c(4,5,6,7,8) for male and female separately ? Thank you very much. Zhao Jin [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-hel

Re: [R] Help!!! from R beginner

2011-02-05 Thread Tae-Jin Lee
Hello Jim, Thank you so much!!! It is a magic!!! Now I understand the use of ifelse. Thank you again!!! Tae-Jin On Feb 5, 2011, at 12:49 AM, jim holtman wrote: You should be able to use 'ifelse' Os.chr4.gene.new$color <- ifelse(Os.chr4.gene.new$if_TE_related == "T

[R] Fwd: Help!!! from R beginner

2011-02-04 Thread Tae-Jin Lee
Sorry. I made a typo. It is the 5th column (not 4th). Thank you. Tae-Jin Begin forwarded message: > From: Tae-Jin Lee > Date: February 4, 2011 7:09:38 PM EST > To: r-help@R-project.org > Subject: Help!!! from R beginner > > Hello, > > I'm trying to add a column to

[R] Help!!! from R beginner

2011-02-04 Thread Tae-Jin Lee
following code to do this job using function and loop, but it is not working. If someone help me, I would really appreciate!!! The original data frame is Os.chr4.gene.new. Gene <- Os.chr4.gene.new[, c("if_TE_related")] Genecolor <- function(Gene) { lg <-length(Gen

[R] Link prediction in social network with R

2010-12-21 Thread EU JIN LOK
common neightbours, PropFlow, etc 3) How to implement a supervised learning method such as random forest (I am guessing I need to obtain a feature list but again, how can I get the scores for the edges)? Hope I've explain my questions well but do let me kno

[R] help on lme extraction

2010-10-25 Thread Jin, Jp
1 ## between Male and Female Male Female [1,] -1 0 [2,]0 0 [3,]0 0 [4,]0 1 I'll greatly appreciate it if you may help! JP Jin Ph.D. Bioinformatics scientist Center for Bioinformatics UNC at Chapel Hill Chapel Hill

[R] how to use glm for a time course data set

2010-08-27 Thread Jin, Jp
.Treatment vs. Measurement.T2.M6.placebo (I did not include Treatment as a factor in the query below yet). Thanks for your help (data was attached)! Jp Jin > summary(glm(data$Lesion.Size~Time+Measurement+Time*Measurement, data=data)) Call: glm(formula = data$Lesion.Size ~ Time + Measurement + T

[R] Interactive R Learning Website

2010-06-21 Thread Lanna Jin
) http://science.nature.nps.gov/im/monitor/stats/sandbox Thanks! Lanna Jin - Lanna Jin lanna...@gmail.com 510-898-8525 -- View this message in context: http://r.789695.n4.nabble.com/Interactive-R-Learning-Website-tp2263270p2263270.html Sent from the R help

[R] Gamma regression doesn't converge

2010-05-30 Thread Sherrie Jin
When I ran a Gamma regression in SAS, the algorithm converged. When I ran it in R, it keeps uncoverged even if I used 1 iterations. What was wrong? I used the following code in R: glm(y ~ x1 x2 x3, control=glm.control(maxit=1), data, family=Gamma(link="log")) [[alternative HTML ver

Re: [R] How can I fit a fixed-effect linear model or generalized linear model with method="ml"?

2010-05-30 Thread Sherrie Jin
the standard errors with method "reml"? I'm pretty new to R and haven't write any code by myself. Thanks. On Sun, May 30, 2010 at 8:01 AM, Prof Brian Ripley wrote: > On Sun, 30 May 2010, Achim Zeileis wrote: > > On Sun, 30 May 2010, Sherrie Jin wrote: >> >>

[R] How can I fit a fixed-effect linear model or generalized linear model with method="ml"?

2010-05-30 Thread Sherrie Jin
Hi, I want to fit a linear model (without any random effect) with method "ml". I tried to use "glm" I found that there is no option for "ml" or "reml" and the default one is "reml". THen I tried to use "lme" but it requires a random effect. How can I fix this problem? Of course, it's not necessa

[R] Fixed-effect linear model with method="ml"?

2010-05-29 Thread Sherrie Jin
Hi, When I try to fit a linear fixed-effect model, I was using "glm". I found that there is no option for "ml" or "reml" and the default one is "reml". How can I use "ml" instead? Of course, it's not necessary to be "glm", I am just looking for commands which allow me to fit a linear model (witho

[R] R for web browser

2010-05-04 Thread Lanna Jin
Hi Everyone, Does anyone know of any projects for running an interactive R session within a web browser? I'm looking for something similar to the one on the Ruby website (http://tryruby.org), except for R. Thanks for your responses in advance! Lanna - Lanna Jin lanna...@gmail.com 51

Re: [R] How to replace all values in a data.frame with another ( not 0) value

2010-05-04 Thread Lanna Jin
Whoops, my bad. Maybe try using "gsub" ----- Lanna Jin lanna...@gmail.com 510-898-8525 -- View this message in context: http://r.789695.n4.nabble.com/How-to-replace-all-NA-values-in-a-data-frame-with-another-not-0-value-tp2125458p2125471.html Sent from the R help mailing list

Re: [R] How to replace all values in a data.frame with another ( not 0) value

2010-05-04 Thread Lanna Jin
Try: "x[which(is.na(x)),] <- 000/000", where is x is your data frame ----- Lanna Jin lanna...@gmail.com 510-898-8525 -- View this message in context: http://r.789695.n4.nabble.com/How-to-replace-all-NA-values-in-a-data-frame-with-another-not-0-value-tp2125458p2125464.html Se

Re: [R] Delete rows with duplicate field...

2010-05-03 Thread Lanna Jin
names() - Lanna Jin lanna...@gmail.com 510-898-8525 -- View this message in context: http://r.789695.n4.nabble.com/Delete-rows-with-duplicate-field-tp2123939p2124036.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r

Re: [R] Delete rows with duplicate field...

2010-05-03 Thread Lanna Jin
if that doesn't work, maybe also try: if x is your data frame with length a columns, "unique(x[,1:a])". - Lanna Jin lanna...@gmail.com 510-898-8525 -- View this message in context: http://r.789695.n4.nabble.com/Delete-rows-with-duplicate-field-tp2123939p2123964.html Sent

Re: [R] Delete rows with duplicate field...

2010-05-03 Thread Lanna Jin
Did you try: if x is the data frame, unique(x)? - Lanna Jin lanna...@gmail.com 510-898-8525 -- View this message in context: http://r.789695.n4.nabble.com/Delete-rows-with-duplicate-field-tp2123939p2123956.html Sent from the R help mailing list archive at Nabble.com

Re: [R] Delete rows with duplicate field...

2010-05-03 Thread Lanna Jin
Try, unique(dataset[,1:a]), where a is the number of columns that you have. 1:a would apply the unique to all columns. - Lanna Jin lanna...@gmail.com 510-898-8525 -- View this message in context: http://r.789695.n4.nabble.com/Delete-rows-with-duplicate-field-tp2123939p2123976.html Sent

Re: [R] short question about data frame manipulation

2010-04-30 Thread Lanna Jin
df[1:2]<-df[1:2]*-1 - Lanna Jin lanna...@gmail.com 510-898-8525 -- View this message in context: http://r.789695.n4.nabble.com/short-question-about-data-frame-manipulation-tp2076891p2076899.html Sent from the R help mailing list archive at Nabble.

Re: [R] Dynamische Programmierung mit R

2010-04-30 Thread Lanna Jin
Weiss ich nicht genau ob es in R gibt, aber versuch mal Processing.org - Lanna Jin lanna...@gmail.com 510-898-8525 -- View this message in context: http://r.789695.n4.nabble.com/Dynamische-Programmierung-mit-R-tp2076695p2076909.html Sent from the R help mailing list archive at Nabble.com

[R] 3D surface plot with wireframe or persp?

2010-04-20 Thread Jin
se - "persp" and "wireframe", Is there another suggestion? 2) Is it possible to plot with only a function? 3) If not, what is wrong in the code above? Many thank you in advance, Jin -- View this message in context: http://n4.nabble.com/3D-surface-plot-with-wireframe-or-persp-t

[R] plotting a function

2010-03-31 Thread Jin
Hello Dear, I am trying to plot a function to see a minimum point (actually, using "optim"). For example, 1. y=f(x) 2. x has a range 3. plot(x,y) to see a point x minimizing y I tried "plot(x,y)", but it made an error. Am I doing a right way? Thanks, Jin -- View thi

[R] generating samples by Monte Carlo

2010-03-29 Thread Jin
Hello Dear, I am trying to generate samples by using Monte Carlo simulation. For example, 1000 samples, Exponential distribution (f(x), lambda=0.0005, 0<=x<=360) Is there any package for Monte Carlo or just use random sample generation function? Many thank you for your help in advance

Re: [R] how to deal with vector[0]?

2010-03-25 Thread Jin
4642jinsuk@nrel.gov Date: Thu, 25 Mar 2010 07:48:40 -0800 From: ml-node+1690861-886360020-66...@n4.nabble.com To: realst...@hotmail.com Subject: Re: how to deal with vector[0]? Jin wrote: Hi, I have a vector with 4 elements, e.g., tau_i=c(100,200,300,400), but potentially tau_i[0]=0. In a

[R] how to deal with vector[0]?

2010-03-25 Thread Jin
it should be "100". Is there anyone can help me solve this problem? Best, Jin NREL, Golden CO (303) 275-4642 -- View this message in context: http://n4.nabble.com/how-to-deal-with-vector-0-tp1690812p1690812.html Sent from the R help mailing list archive at Nabble.com.

Re: [R] nested looping functions and dataframes

2010-03-16 Thread Lanna Jin
Department of Statistics > UC Berkeley > spec...@stat.berkeley.edu > > > On Tue, 16 Mar 2010, Lanna Jin wrote: > > >> Hey All, >> >> So, I am confused how exactly to use nesting loop fu

[R] nested looping functions and dataframes

2010-03-16 Thread Lanna Jin
have searched through the R-help archives for hints, which have not been successful in answering my question. As a new user to R and programming languages, I truly appreciate your help and thank you for your patience. Thanks in advance for your response, Lanna Jin - Lanna Jin lanna...@gmai

[R] Fwd: function to create multiple matrices

2010-03-11 Thread Lanna Jin
, measure='PlotFreq') x.binary <- cast(x.m, Year + LocationID ~ SpeciesCode, length) On Thu, Mar 11, 2010 at 10:55 AM, Lanna Jin wrote: >>>> >>>>> Hi Jim, >>>>> >>>>> Here's an example of what I mean by a binary matrix ( 1

[R] function to create multiple matrices

2010-03-10 Thread Lanna Jin
a function? Thanks in advance for your suggestions! -- Lanna Jin lanna...@gmail.com 510-898-8525 [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting

[R] Graphics Question

2010-02-18 Thread Lanna Jin
of the plots stacked on top of each other with the same axis dimensions and ranges. Thanks for your help in advance! -- Lanna Jin lanna...@gmail.com 510-898-8525 [[alternative HTML version deleted]] __ R-help@r-project.org mailing list http

[R] zeros keep dropping

2009-10-26 Thread Lanna Jin
Hello All! I am trying to plot the frequency of species coocurrance. If given a data set similar like this...(V1="species A", V2="species B", V3="frequency of cooccurance") > data V1 V2 V3 1 A B 0 2 A C 2 3 A D 5 4 B C 0 5 B D 1 6 C D 0 > data1<-as.data.frame(lapply(data,funct

Re: [R] 回复: cch() and coxph() for case-coh ort

2008-07-16 Thread Jin Wang
How can we implement Prentice jacknife variance estimation in R strictly? Thanks 2008/6/17 Thomas Lumley <[EMAIL PROTECTED]>: > On Mon, 16 Jun 2008, Peter Dalgaard wrote: > > Jin Wang wrote: >> >>> I tried to compare if cch() and coxph() can generate same result

[R] implementation of Prentice method in cch()

2008-07-15 Thread Jin Wang
Case cohort function cch() is in survival package. In cch(), the prentice method is implemented like this: Prentice <- function(tenter, texit, cc, id, X, ntot,robust){ eps <- 0.0001 cens <- as.numeric(cc>0) # Censorship indicators subcoh <- as.numeric(cc<2) # Subcohort indicators

[R] How to run coxph() with time dependent cohort sampling

2008-06-30 Thread Jin Wang
Now that we have case cohort model , we have 1000 people and 50 cases Let the first 10 cases occur at the same time second 10 " third 10 " fourth 10" fifth10" How easy is it to randomly sample 50 di

[R] 回复: cch() and coxph() for case-coh ort

2008-06-16 Thread Jin Wang
eIII 0.597 1.818 1.285 2.571 0.001 stageIV 1.392 4.021 2.670 6.057 0.000 histolUH 1.506 4.507 3.274 6.203 0.000 age 0.043 1.044 0.996 1.095 0.069 2008/6/12, Terry Therneau <[EMAIL PROTECTED]>: > Jin Wang had an error. My original note specified a variable that was 1 for > subje

Re: [R] cch function and time dependent covariates

2008-06-12 Thread Jin Wang
1.allison.2 <- cch(Surv(start, stop, arrest.time) ~ + fin + age + race + wexp + mar + paro + prio + employed, + data=ccoh1.data.fold,subcoh=~subcohort,id=~seqno,cohort.size=19809) Error in cch(Surv(start, stop, arrest.time) ~ fin + age + race + wexp + : Multiple records per id not allow

Re: [R] cch function and time dependent covariates

2008-06-12 Thread Jin Wang
I tried your alternative method on the example in cch() description manual. The example data "nwtco" has not time-dependent covariates yet. I test cch() and coxph() on the same data. But the estimation result is different. I don't know if I did anything wrong. subcoh <- nwtco$in.subcohort selccoh

[R] I wonder if cch function in Survival package can calculate time dependent covariate

2008-06-11 Thread Jin Wang
ity or not? The cch() manual does not say if time dependent covariate is allowed I know coxph() in Survival package can estimate time dependent covariates. Thanks Jin Wang [[alternative HTML version deleted]] __ R-help@r-project.org mailing

Re: [R] Conditional Autoregressive (CAR) model simulation

2008-02-19 Thread Dae-Jin Lee
corr_x # cor(a_x,lag(col.W,a_x)) [,1] [1,] 0.06929324 # == I don't know if I'm simulating correctly the CAR, any help? Thanks in advance 2008/2/15, Henrique Dallazuanna <[EMAIL PROTECTED]>: > > See spautolm

[R] Conditional Autoregressive (CAR) model simulation

2008-02-15 Thread Dae-Jin Lee
library, but this is not what I'm looking for Thanks in advance Dae-Jin -- ______ Dae-Jin Lee Office/Despacho: 7.3.J04 Phone/Tlfno:+34 91 624 9175 Fax: +34 91 624 9430 Departamento de Estadística Av. Universidad 30, Ed. Juan Benet 28911 Leganés (Madrid), SPA

[R] mcv package gamm function Error in chol(XVX + S)

2007-10-02 Thread Dae-Jin Lee
Hi all R users ! I'm using gamm function from Simon Wood's mgcv package, to fit a spatial regression Generalized Additive Mixed Model, as covariates I have the geographical longitude and latitude locations of indexed data. I include a random effect for each district (dist) so the code is fit <- g