[R] 2SLS with Fixed Effects and Control Variables

2024-01-29 Thread Kelis Wong
tage` | `Log Real Minimum Wage` + `Log Real Minimum Wage2` + IVinteration + Region + Year + Region:Year + `Woman Percentage` + `Noneducated Percentage`, dataset)) -- Peace, Kelis Wong [[alternative HTML version deleted]] __ R-help@r-proje

[R] 2023 John M. Chambers Software Award

2022-12-01 Thread Raymond Wong via R-help
statistical software written by, or in collaboration with, an undergraduate or graduate student. Please visit http://asa.stat.uconn.edu for more information. Best regards, Sincerely, Raymond Wong Awards Chair ASA Section on Statistical Computing ASA Section on Statistical Graphics [[alternative

[R] 2023 John M. Chambers Software Award

2022-11-15 Thread Raymond Wong via R-help
. Best regards, Raymond Wong Awards Chair ASA Section on Statistical Computing ASA Section on Statistical Graphics Associate Professor Department of Statistics Texas A&M University [[alternative HTML version deleted]] __ R-help@r-project

[R] Seeking Nomination for the Statistical Computing and Graphics Award

2022-03-17 Thread Raymond Wong via R-help
two pages Selection Process The Awards Committee will consist of the Chairs and Past Chairs of the Sections on Statistical Computing and Statistical Graphics. The committee will meet at the 2022 JSM to select the recipient(s) of the award. Nominations and questions are to be sent to Dr. Raymond

[R] 2022 John M. Chambers Software Award

2021-12-02 Thread Raymond Wong
Dear R-help listers, I would like to let you know that submission window of the John M. Chambers Software Award is now open. The submission deadline is December 15, 2021. The Statistical Computing Section of the American Statistical Association announces the competition for the John M. Chambers

[R] heatmap ploting

2021-11-05 Thread Stephen HonKit Wong
Dear Community, I have an example heatmap plot in this link which was generated by java I believe, I want to make a similar plot in R. Any clues on how to do it? Thanks. The column is a gene, and the rows are dif

[R] 2022 John M. Chambers Software Award

2021-10-09 Thread Raymond Wong
. Best regards, Raymond Wong Awards Chair ASA Section on Statistical Computing ASA Section on Statistical Graphics Associate Professor Department of Statistics Texas A&M University [[alternative HTML version deleted]] __ R-help@r-project

[R] 2021 John M. Chambers Software Award

2020-12-01 Thread Raymond Wong
statistical software written by, or in collaboration with, an undergraduate or graduate student. Please visit http://asa.stat.uconn.edu for more information. Best regards, Raymond Wong Awards Chair ASA Section on Statistical Computing Associate Professor Department of Statistics Texas A&M Univer

[R] 2021 John M. Chambers Software Award

2020-11-20 Thread Raymond Wong
http://asa.stat.uconn.edu <http://asa.stat.uconn.edu/> for more information. Best regards, Raymond Wong Awards Chair ASA Section on Statistical Computing Associate Professor Department of Statistics Texas A&M University [[alternative HTML versi

[R] 2021 John M. Chambers Software Award

2020-10-14 Thread Raymond Wong
ttp://asa.stat.uconn.edu/> for more information. Best regards, Raymond Wong Awards Chair ASA Section on Statistical Computing Associate Professor Department of Statistics Texas A&M University [[alternative HTML version deleted]] __ R-help@r-project.o

[R] Problem in using 'plm' package after updating R

2019-06-04 Thread Wong David
pplication/x-gzip' length 2343782 bytes (2.2 MB) downloaded 2.2 MB * installing *source* package 'plm' ... ** package 'plm' successfully unpacked and MD5 sums checked ** R ** data ** inst ** preparing package for lazy loading Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libP

[R] Problem of data format using function of tmerger()

2019-03-20 Thread wong jane
We want to perform a survival analysis using time-dependent covariates in the Cox regression. In this analysis, ESRD1_END and ESRD1_TIME are the outcome and follow-up time,respectively. AKI_END is a binary time-dependent variable, while AKI_TIME is the time point for AKI_END measurement. The Cox mo

Re: [R] How to change the number of bins?

2019-03-10 Thread wong bowie
y a measured value but rather > is a missing value indicator. > > > -- > > David. > > On 3/10/19 1:54 PM, wong bowie wrote: > > I wish to calculate the weight of evidence of a variable x, which is > > positively skewed, with over 6000 of the observations are 999 but onl

[R] How to change the number of bins?

2019-03-10 Thread wong bowie
I wish to calculate the weight of evidence of a variable x, which is positively skewed, with over 6000 of the observations are 999 but only 200 range from 1-27. I used the code, “IV<-create_infotables(data=Test[,-1],y="class",bins=10)” However, no matter what number I used in bins parameter, I ca

Re: [R] How to modify data frame stored in a list

2018-06-18 Thread Honkit Wong
t; > "The trouble with having an open mind is that people keep coming along and > sticking things into it." > -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) > >> On Mon, Jun 18, 2018 at 1:46 PM, Honkit Wong wrote: >> Dear R community

[R] How to modify data frame stored in a list

2018-06-18 Thread Honkit Wong
Dear R community, I have a question seems very simple but have trouble to do it. I have a list which stores many data frames. Now, I want to perform log10 on one column in each data frame in the list and save the value as a new column back to the original data frame in the list. How do I quickly

[R] how to make the code more efficient using lapply

2018-05-24 Thread Stephen HonKit Wong
Dear All, I have a following for-loop code which is basically intended to read in many excel files (each file has many columns and rows) in a directory and extract the some rows and columns out of each file and then combine them together into a dataframe. I use for loop which can do the work but q

[R] Fitting problem for Cox model with Strata as interaction term

2018-05-08 Thread wong jane
Dear All, I got a warning message "X matrix deemed to be singular" in Cox model with a time dependent coefficient. In my analysis, the variable "SEX" is a categorical variable which violate the PH assumption in Cox. I first used the survSplit() function to break the data set into different time i

[R] how to make row.names based on column1 with duplicated values

2018-02-28 Thread Stephen HonKit Wong
Dear All, Suppose I have a dataframe like this with many thousands rows all with different names: data.frame(gene=c("a","b","c","d","c","d","c","f"),value=c(20,300,48,55,9,2,100,200)), I want to set column "gene" as row.names, but there are duplicates (c, d), which I want to transform into this as

[R] a difficult situation, how to do this using base function.

2017-07-21 Thread Stephen HonKit Wong
Hello, I have a following dataframe with many rows. data.frame(match.start=c(5,10,100,200),range.coordinates=c("1000-1050","1500-1555","5000-5050,6000-6180","100-150,200-260,600-900")) match.start range.coordinates 5 1000-1050 10 1500-1555

[R] Error using nlme; Malformed factors

2016-12-21 Thread Wong Yoke Yong
HI all, I am using the nlme package to learn multilevel models, and following examples from the textbook "Discovering Statistics Using R" when it happened. [Mixed Models Code][1] The data set is Honeymoon Period.dat, also downloadable under their companion website. [Data Set - Multilevel Models

[R] Anova() type iii SS plots and diagnostics

2016-07-18 Thread Pamela Wong
I am wondering if there is a way to plot results and model diagnostics (to check for outliers, homoscedasticity, normality, collinearity) using type III sums of squares in R __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://st

[R] Type III SS and collinearity in R

2016-07-17 Thread Pamela Wong
Hi there It appears the Anova() function in the car package cannot compute type III SS when there is collinearity in the model. Has anyone else run into this problem? I would use drop1() to obtain the SS but it does not provide the intercept... __ R-he

[R] Troubleshooting Type III SS and drop1()

2016-07-16 Thread Pamela Wong
Hi there I am trying to compute Type III SS plus model selection and find that an error pops up when I'm trying to use the drop1() function with a model output using Anova(). I am looking at effects of four factors and their interactions (with unbalanced sample sizes across some factor groups),

Re: [R] how to use vectorization instead of for loop

2016-03-21 Thread Stephen HK WONG
sing ifelse ? Thanks. From: ruipbarra...@sapo.pt Sent: Monday, March 21, 2016 11:50 AM To: Stephen HK WONG Cc: r-help@r-project.org Subject: Re: [R] how to use vectorization instead of for loop Hello, I've renamed your dataframe to 'dat'. Since ?ifelse is vectorized, try dat[, 4

[R] how to use vectorization instead of for loop

2016-03-21 Thread Stephen HK WONG
mn. I can do this with for loop like below but it is not efficient. Is there a better way to use a vectorization method instead of loop? Many thanks! for (i in 1:nrow(dataframe)) { if dataframe[i, 2]>0 { dataframe[i, 4]<- 1 * (1/dataframe[i,3])} else{ datafra

[R] Complete archives for MARC needed for r-devel, r-help and r-packages

2016-02-09 Thread Tae Wong
I need the archives for r-help from October 2007 to November 2013 in MARC [1]. The same goes for r-devel [2] who needs archives for July 2005 to November 2013 and r-packages [3] needing archives for August 2007 to December 2013. P.S.: I'm not subscribed to this mailing list. [1] http://marc.info

[R] How to pass a variable to a function which use variable name as a parameter

2015-05-26 Thread wong jane
There are functions which use variable names as parameters in some R packages. However, if the variable name is stored in another variable, how can I pass this variable to the function. Taking the "rms" package as an example: library(rms) n <- 1000 age <- rnorm(n, 50, 10) sex <- factor(sample(c('f

[R] how to loop through dataframe objects in environment

2014-10-15 Thread Stephen HK Wong
rough all objects and perform the similar action ? One way I can think of is like this: for (i in 1:50){ get(ls()[i])[,3]+get(ls()[i][,4] } But I don't know how to save the addition result back to 5th column of each dataframe. Many Thanks! Steph

Re: [R] read.table() 1Gb text dataframe

2014-09-19 Thread Stephen HK Wong
information on documentation. Stephen HK Wong Stanford, California 94305-5324 - Original Message - From: Henrik Bengtsson To: Stephen HK Wong Cc: r-help@r-project.org Sent: Thu, 18 Sep 2014 18:33:15 -0700 (PDT) Subject: Re: [R] read.table() 1Gb text dataframe As a start, make sure

[R] read.table() 1Gb text dataframe

2014-09-18 Thread Stephen HK Wong
using colbycol package, but it is not not available. Many thanks!! Stephen HK Wong Stanford, California 94305-5324 __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-projec

[R] How to randomly extract a number of rows in a data frame

2014-08-01 Thread Stephen HK Wong
275 - chr13005558 3005593 - chr13005890 3005925 + chr13005929 3005964 + chr13005913 3005948 - chr13005913 3005948 - Stephen HK Wong __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read t

[R] Weighted Logistic Regression in R: Can R do what SAS PROC LOGISTIC does?

2014-08-01 Thread Sam Wong
I wonder if anyone has written some additional R code to perform weighted logistic regression in the way of SAS PROC LGOISTIC WEIGHT statement. I want to weight the sample using a vector of probabilities generated from Dirichlet distribution. It is known that the R function glm has a WEIGHT op

[R] how to extract word before /// in a data frame contain many thousands rows.

2014-07-31 Thread Stephen HK Wong
_a_at", "1552902_a_at", "1552903_at"), Gene.Symbol = c("CORO6", "CDH23 /// LOC100653137", "IRF6", "GRHL1", "KCNH8", "CADM2", "TSNARE1", "KCNG3", "FOXP2", "B4GALNT2&quo

[R] Cox regression model for matched data with replacement

2014-06-22 Thread wong jane
My problem was how to build a Cox model for the matched data (1:n) with replacement. Usually, we can use stratified Cox regression model when the data were matched without replacement. However, if the data were matched with replacement, due to the re-use of subjects, we should give a weight for eac

[R] Restricted Cubic Spline using rms package

2014-02-25 Thread wong jane
I am trying to use restricted cubic spline to examine the association between an independent variable and outcome. When I plot the relationship between HR and the independent variable, I found the HR is not equal to 1 for the specified reference value. For example: dat <- read.table("mydata.csv")

[R] how to GREP out a string like this......THANKS.

2013-05-20 Thread Hon Kit (Stephen) Wong
. Stephen HK Wong Stephen HK Wong Research Associate,Cleary Lab Lab Phone: 650-723-5340 MC 5457 Lokey Stem Cell Research Building 265 Campus Drive, Rm. G2035 Stanford, California 94305-5324 __ R-help@r-project.org mailing list https://stat.ethz.ch

[R] a newbie seeking for a simple problem

2012-09-02 Thread Hon Kit (Stephen) Wong
Dear Experienced R users, I have a looks-like simple but complicated problem urgently needed to be solved. Below is the detail: I have two dataframes, df1, df2. df1 contains two column and many thousands rows: column 1 is a "gene_name", column 2 is "value". df2 contains only one column which i

[R] mlogit package inquiry

2012-05-29 Thread Wong Hang
V1 + V2 + V3 + V4,data=mydata)   and then compute my probability estimate from the coefficients? What are the difference if I put variable between the separator |  ?   Thank you very much. Best regards, WONG Hang. __ R-help@r-project.org mailing list ht

[R] rpart weight parameter and random forest based on rpart

2011-12-20 Thread Wong Hang
eferencing to randomForest package, is there any meta-algorithm package available for this purpose? Thank you very much. Best regards, WONG Hang. P.S. I have tested party package also. But it is not quite suitable for me and I face some errors on it. [[alternative HTML ve

[R] Problem about plotting the correlation coefficients

2011-10-24 Thread Maggie Wong
Hi, I am writing a program to plot the correlation coefficients of 45 elements using the commend "plot". Error message "Error in plot.new() : figure margins too large" appeared. I think it may because there are too many elements. But I really need to find their correlation coefficients. What can I

[R] Perform 20 x one-way anova in 1 go

2011-10-11 Thread Joshua Wong
Hi Guys, I have about 20 continous predictors and I want to do one-way anova to check the significance of each variable against the dependent variable. Apart from doing running the anova 20 times, is there a faster way? Thanks, Joshua [[alternative HTML version deleted]] ___

Re: [R] Adding same items together in data.frame

2011-05-16 Thread wong, honkit (Stephen)
Thanks !! This aggregate function is really powerful to do this kind of manipulation! Looks like R is quite versatile for text manipulation, I don't need to learn Perl language. Appreciate all your guys help! WONG, Hon-Kit (Stephen) Cleary Lab, Dept of Pathology Stanford University Lokey

[R] Adding same items together in data.frame

2011-05-13 Thread wong, honkit (Stephen)
bb 10 cc 9 aa 30 aa 24 dd 100 ee 55 ... Millions thanks. Best Regards, hon WONG, Hon-Kit (Stephen) Cleary Lab, Dept of Pathology Stanford University __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/

[R] Problem about step and stepAIC

2011-04-26 Thread Maggie Wong
Hello, I am now running a multiple linear regression program, but I do not know the difference between the command step and stepAIC. Thanks. Maggie [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/

[R] Standard Error for Cointegration Results

2011-04-03 Thread Kin Ming Wong
Dear Sir/Madam, I have used ca.jo in urca package to identify the cointegration and cajorls to estimate the vecm. Althought both return the coefficients for long run relationship (or ect1 in cajorls), I am unable to find the standard error and t statistics. I spend some weeks to search arou

Re: [R] Discretizing data rows into regular intervals

2011-04-03 Thread wulei wong
i suggest you'd better translate the.data format to another form like in SAS, the data can be a number count from a fixed time like 2005-01-01, then you can translate the datas to a sequence. On 03-Apr-2011 5:40 PM, "Gabor Grothendieck" wrote: On Sat, Apr 2, 2011 at 9:31 PM, Linh Tran wrote: >

Re: [R] R gui on windows how to force to always show the last line of output

2011-04-03 Thread wulei wong
i wonder why you want to change R but not your program itself, you just print the last sentence is ok? wuleiwong statistic@CSU On 03-Apr-2011 9:06 PM, "lcn" wrote: CTRL+L helps. 2011/4/2 stan zimine > Hi. > Googled but did not found the answer for the following little issue. > > how to force

[R] Fw: Re: help in calculating ar on ranked vector

2011-01-17 Thread Raymond Wong
--- On Mon, 1/17/11, Raymond Wong wrote: From: Raymond Wong Subject: Re: [R] help in calculating ar on ranked vector To: "Uwe Ligges" Received: Monday, January 17, 2011, 11:56 AM Thanks Uwe:   Here is my code. the first set of print statements work, but not the sec

[R] help in calculating ar on ranked vector

2011-01-12 Thread Raymond Wong
I was using ar(stats) to calculate autoregressive coefficient. It works on vector z, but it will not work on vector rz <-rank (z, ties.method="average").  What did I miss? Any info will be greatly appreciated.  TIA [[alternative HTML version deleted]] __

[R] newbie question on importing and parsing file by row

2010-11-05 Thread Emily Wong
Hi, I'm new to R and I have a file with many rows of values. Each row contains a title and values for a contingency table e.g. row 1= title8 0 37796 47 which is a table called 'title' with values 8 0 37796 47 I would like to know how I can import this using R and for each

[R] Package for GLMM with correlation matrix

2010-10-21 Thread wong
Hi, I'm looking for a R package for fitting a generalized linear mixed model g(E[yi])=â*xi+ui where g is a link function, subscript i represents the individual id, â is fixed effect coefficient, ui is a random effect with E[u]=0 and covariance Cov[u]=G*ó^2, in which G is a correlation matrix.

Re: [R] ifelse command

2010-08-18 Thread Philip Wong
Hi Dennis, I see your point about using a different name for the runif() functions, other then the one I used to stimulate the bias coins. I start to get what you and David meant after thinking it through for a while regarding with comparison the biased dice and the uniform distribution, but the

Re: [R] ifelse command

2010-08-18 Thread Philip Wong
Hi Josh, I think I know where does the 50+ warning is coming from, because I used n in runif(n), similarly I get 50+ warnings if I use runif(1000). Yet if I use runif(1) the warnings() doesn't show. -- View this message in context: http://r.789695.n4.nabble.com/ifelse-command-tp2329538p2330597.

Re: [R] ifelse command

2010-08-18 Thread Philip Wong
well to be honest, it is a assignment for the Bayesian statistic paper I wish to take later in the academic year. But I'm a slow learner, so I'm going to try out some of the assignments posted in the university forum hoping to get some practice in advance. Could you please elaborate more on the

[R] ifelse command

2010-08-18 Thread Philip Wong
hello people, I want to make a biased dice using the sample() function and print out the results after n number of runs, I've successfully generated the dice using the following command: mydie2<-function(n=1000,y=NULL,...){ for(i in 1:n){ x<-sample(1:6,n,replace=TRUE,prob=c(1,1,2,3,2,1)/10) x=runi

Re: [R] Contingency Table Analysis - specific cell to specific cell comparisons

2010-07-22 Thread Tsunhin John Wong
1, 2010, at 8:07 AM, Tsunhin John Wong wrote: > >> Dear R users, >> >> I have a question of how to do some specific cell to cell comparisons >> on a R x C contingency table. >> The table is a 3 x 5 table with frequency / count data. >> >>> langco

[R] Contingency Table Analysis - specific cell to specific cell comparisons

2010-07-21 Thread Tsunhin John Wong
Dear R users, I have a question of how to do some specific cell to cell comparisons on a R x C contingency table. The table is a 3 x 5 table with frequency / count data. > langcons.table <- table(lang, cons) > langcons.table[cbind(lang,cons)] <- freq > langcons.table Adj Int Oth Pas Tra C 69

[R] what command to use for standization

2010-05-29 Thread Philip Wong
what command to use to standardize my data to mean = 0, and SD=1. the data I want to standardize/centroid is in column format. So I'm thinking of using: col.mean.stdised=apply(data.df,2,function(z){z-mean(z)}) but, what command should I use to put my SD =1? Thanks! -- View this message in co

[R] Scree diagram,

2010-05-01 Thread Philip Wong
hello, I've two questions today. 1) I'm trying to do a scree diagram, I did a Google for a specific command I could used to do so. All I could find is a screeplot. Are they the same command? 2) what command can I used to present a PC scores, eigenvectors of the PC scores, and component correlat

[R] how can I stop getting email from every comment posted in this forum?

2010-04-07 Thread Philip Wong
hello people, I didn't know where should post this thread, I asked Hugo the nabble administrator and his response was I should be able to unsubscribed from getting an email from every comment or response posted here. Yet I couldn't find the method nor the button to click to do so. I even change

[R] Problems faced with Levene Test using R

2010-03-27 Thread Philip Wong
Hello everyone, I'm trying to build Levene's test. The below command is what I used to do the test, I also included the error it prompts up and some data example that I used when trying to build the test. Can someone please tell me what did I do wrong? thanks in advance! > res=lm(as.matrix(xx$B

Re: [R] producing a QQ plot.

2010-03-27 Thread Philip Wong
Aha! I see now! thanks guys! really helpful! -- View this message in context: http://n4.nabble.com/producing-a-QQ-plot-tp1693228p1693259.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.et

Re: [R] producing a QQ plot.

2010-03-27 Thread Philip Wong
Hello, this is the first 10 data of the population. country village group av_expenP2ary_edno_fisher B_Leth B_LutjanWt_Leth Wt_Lutjan Cook IslandsAitutakiD 5239.127472 0.7 666.9998558 3.286283997 1.971519001 520.6454552

[R] producing a QQ plot.

2010-03-27 Thread Philip Wong
Hello everyone I'm a beginner in Stats and R, I'm using R 2.10.1. I need to create a multivariate qq plot, there is 8 variable group with each has 55 number of input. An example of what I did so far, just to get my point out: > data=read.csv(file.choose(),header=T) > data country

[R] FW: help with time Series regression please

2010-01-21 Thread snowcat wong
exam the periodogram of the residuals. I am not sure this step is right or not? Which is the best formula to analysis the trend and seasonality for this data set? AR, MA or ARMA and how to decide? Please help!! many thanks and regard, Cathy Wong

[R] help with time Series regression please

2010-01-19 Thread snowcat wong
exam the periodogram of the residuals. I am not sure this step is right or not? Which is the best formula to analysis the trend and seasonality for this data set? AR, MA or ARMA and how to decide? Please help!! many thanks and regard, Cathy Wong Got a cool Hotmail story? Tell us now

[R] FW: help with time Series regression please

2010-01-19 Thread snowcat wong
exam the periodogram of the residuals. I am not sure this step is right or not? Which is the best formula to analysis the trend and seasonality for this data set? AR, MA or ARMA and how to decide? Please help!! many thanks and regard, Cathy Wong

[R] errors appears in my time Series regression fomula

2010-01-18 Thread snowcat wong
set quarterly sales of spirits series, what is the best model to use?? Should I use ARIMA?? Many thanks and regard, Cathy Wong _ Got a cool Hotmail story? Tell us now options(wi

[R] How to use results of distribution fitting for further processing?

2009-11-20 Thread Raymond Wong
This is probably simple, but I have a hard time finding the solution. Any help greatly appreciated.   I would like to use the results of fitdistr(z,densfun=dweibull,start=list(scale=1,shape=1)) for further processing.  How do I assign the values of scale and shape to b and a without manually en

[R] Re tain current graphs in figure

2009-09-24 Thread Natalie Wong
I want to know, how do I retain the current plot and axes properties such that subsequent graphing commands add to the existing graph. Thank you very much!! -- View this message in context: http://www.nabble.com/Retain-current-graphs-in-figure-tp25606069p25606069.html Sent from the R help mail

[R] R help - howto suppress chm help and use text/latex help?

2009-07-22 Thread Tsunhin John Wong
Dear R Users, I've installed R with the chm option, but eventually I found I am more used to the normal way of latex help. Is there any argument to suppress chm help by default when starting R? So that I don't have to type something like >help(rle,chmhelp=NULL) I know the last resort would be to

[R] Select cases of data.frame based on a long index

2009-06-03 Thread tsunhin wong
Dear R users, I know how to select a subset of a data.frame or a matrix by setting some criteria, but this time, I have a long index of cases not really related to 1 or 2 criteria. And I cannot find a simple way to select cases from another data.frame based on this index (sublst in this example).

[R] Barplot: annotations at tips of each bar?

2009-06-02 Thread tsunhin wong
Dear R-users, I have searched through examples of barplot in R. But there seems to be no advanced annotation options in R for their barplot. What I am trying to do is to do some annotations at the tip of each bar in a barplot, similar to the graph below: http://www.lakesuperiorstreams.org/understa

Re: [R] Within Subject ANOVA question

2009-06-01 Thread tsunhin wong
nce wrote: > On Mon, Jun 1, 2009 at 7:50 PM, tsunhin wong wrote: >> But I have some follow-up questions: >> 1. In aov, why IVs (subject & condition) cannot be in number format? > > Put simply, because that's the only way to obtain the values you > observe in the p

Re: [R] Within Subject ANOVA question

2009-06-01 Thread tsunhin wong
ll) > aov.recall <- aov(recall~condition + Error(subject/condition),data=example) > summary(aov.recall) Error: subject Df Sum Sq Mean Sq F value Pr(>F) Residuals 9 942.53 104.73 Error: subject:condition Df Sum Sq Mean Sq F valuePr(>F) condition 2 52.267 26.1

[R] Within Subject ANOVA question

2009-06-01 Thread tsunhin wong
Dear R users, I have copied for following table from an article on "Using confidence intervals in within-subject designs": Subject 1sec 2sec 5sec 1 10 13 13 12.00 2 6 8 8 7.33 3 11 14 14 13.00 4 22 23 25 23.33 5 16 18 20 18.00 6 15 17 17 16.33 7 1 1 4 2.00 8 12 15 17 14.67 9 9 12 12 11.00 10 8 9

Re: [R] Search for longest consecutive occurrence

2009-05-23 Thread tsunhin wong
t; with(rle(test), max(lengths[values==0])) [1] 7 Many thanks! - John On Sat, May 23, 2009 at 1:54 PM, Gabor Grothendieck wrote: > !! > > On Sat, May 23, 2009 at 1:52 PM, tsunhin wong wrote: >> Thanks! >> I tested it using: >> test<-c(1,1,1,1,1,0,0,0,0,0,0,0,1

Re: [R] Search for longest consecutive occurrence

2009-05-23 Thread tsunhin wong
max(lengths[!!values])) > > > On Sat, May 23, 2009 at 1:09 PM, tsunhin wong wrote: >> Dear R Users, >> >> I am trying to write a script to count the longest consecutive >> occurring 1 in a sequence: >> test<-c(1,1,1,1,1,1,1,0,0,0,0,1,1,0,1,0,1,0,1

[R] Search for longest consecutive occurrence

2009-05-23 Thread tsunhin wong
Dear R Users, I am trying to write a script to count the longest consecutive occurring 1 in a sequence: test<-c(1,1,1,1,1,1,1,0,0,0,0,1,1,0,1,0,1,0,1,1) In the case of the object "test", 1 occurs 7 consecutive times which is the longest consecutive within the sequence. I know I can always do a th

Re: [R] index to select rows of a large matrix

2009-05-21 Thread tsunhin wong
Dear all, I found the answer: intersect() - John On Thu, May 21, 2009 at 7:32 PM, tsunhin wong wrote: > Dear Jim, > Thanks for your suggestion. > > I have a follow-up question for fellow R Users that have followed this thread: > > *I used to create two lists by some very fl

[R] Paste Strings as logical for functions?

2009-05-21 Thread tsunhin wong
Dear R Users, I have some dynamic selection rules that I want to pass around for my functions: >rules <- paste(g$TrialList==1 & g$Session==2) >myfunction <- function(rules) { > index <- which(rules) > anotherFunction(index) > } However, I can't find a way to pass around these selection rules

Re: [R] index to select rows of a large matrix

2009-05-21 Thread tsunhin wong
drop=FALSE]  # gives you a subset matrix of just the rows you > are interested in. > > On Thu, May 21, 2009 at 10:10 AM, tsunhin wong wrote: >> >> Dear R Users, >> >> I have created a 1500 x 2 data frame - DataSeq. Each of the 1500 >> rows represents a data

[R] index to select rows of a large matrix

2009-05-21 Thread tsunhin wong
Dear R Users, I have created a 1500 x 2 data frame - DataSeq. Each of the 1500 rows represents a data sequence. I have another data frame iData that stores the information of these 1500 data sequences in the same order, for example, condition, gender, etc. If I use "subset" to select certain

[R] Too large a data set to be handled by R?

2009-05-19 Thread tsunhin wong
Dear R users, I have been using a dynamic data extraction from raw files strategy at the moment, but it takes a long long time. In order to save time, I am planning to generate a data set of size 1500 x 2 with each data point a 9-digit decimal number, in order to save my time. I know R is limi

[R] Replace / swap values of subset of a data.frame

2009-05-19 Thread tsunhin wong
Dear R users, I have 1 data.frame of 1500x80 - data1. I found out that there are a few cells of data that I have misplace, and I need to fix the ordering of them. In an attempt trying to swap column 22 & 23 of the Subject with misplaced data, I did the following: > data2 <- data1 > subset(data1,(S

[R] read.table or read.csv without row index?

2009-04-22 Thread tsunhin wong
Hello all, Probably my concepts about the data.frame and matrix and array in R are not clear, I need some clarification to help me understand them better. >M <- read.table("test1.csv",sep=",",row.names=NULL,header=T) gives me: M as M1 M2 M3 M4 M5 M6 M7 M8 M9 M10 1 9 11 14 15 18 20 20 20 20

[R] Multilevel Modeling using R

2009-03-17 Thread WONG, Ka Yau
Dear experts, I use R to conduct multilevel modeling. However, I have a problem about the interpretation of random effect. Unlike the variables in fixed effects, the variables in random effects have not shown the standard error (s.e.) and p-value, so I don't know whether the

Re: [R] Multilevel modeling using R

2009-03-16 Thread WONG, Ka Yau
No standard deviation of variable in the random effect is provided. How to construct CI? Best Regards, Tommy Research Assistant of HKIEd From: ronggui [mailto:ronggui.hu...@gmail.com] Sent: 17/3/2009 [Tue] 14:10 To: WONG, Ka Yau Cc: r-help@r

[R] Multilevel modeling using R

2009-03-16 Thread WONG, Ka Yau
Dear All, I use R to conduct multilevel modeling. However, I have a problem about the interpretation of random effect. Unlike the variables in fixed effects, the variables in random effects have not shown the p-value, so I don't know whether they are significant or not? I want to obta

Re: [R] R editor that will work with Rcmdr

2009-03-06 Thread Ledon Wong, Alain (Portfolio Analytics)
Hi, I also use R under Eclipse/StatET. I found the following doc really useful: http://www.splusbook.com/Rintro/R_Eclipse_StatET.pdf Regards Alain 212-449-4894 -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of John Fox Sent: Frid

[R] initial gradient and vmmin not finite

2009-03-02 Thread June Wong
Dear Rhelpers I have the problem with initial values, could you please tell me how to solve it? Thank you June > p = summary(maxLik(fr,start=c(0,0,0,1,0,-25,-0.2))) Error in maxRoutine(fn = logLik, grad = grad, hess = hess, start = start, : NA in the initial gradient > p = summary(maxL

[R] Rgraphviz install

2009-01-30 Thread June Wong
Hi I've tried several times and followed what others suggest in installing Rgraphviz (https://stat.ethz.ch/pipermail/bioconductor/2008-June/022838.html) But I could not load library(Rgraphviz). There's a message that 'This application has failed to start because libcdt-4.dll was not found'

[R] constrainOptim

2009-01-28 Thread June Wong
Dear R helpers I have a question regarding the constrainOptim. I'm coding the nested logit and would like to set a bound of rho to (0,1] as an extreme value distribution where rho = exp(lambda)/1+exp(lambda) I wonder if I can do that directly in optim (say rho > 0 & <= 1) or need to use const

[R] initial value in 'vmmin' is not finite

2009-01-28 Thread June Wong
Dear r helpers I run the following code for nested logit and got a message that Error in optim(c(0, 0, 0, 0, 0.1, -2, -0.2), fr, hessian = TRUE, method = "BFGS") : initial value in 'vmmin' is not finite What does this mean? and how can I correct it? Thank you June > yogurt = read.table

Re: [R] cannot allocate vector of size... restructuring suggestion please...

2008-12-15 Thread tsunhin wong
Also,each data.frame of the 1500 working as data sources floating in the global environment is of a size ranging from 2000x36 to 9000x36 Please help...! THANKS!!! - John On Mon, Dec 15, 2008 at 1:12 PM, tsunhin wong wrote: > Dear R Users, > > I was running some data analysis script

[R] cannot allocate vector of size... restructuring suggestion please...

2008-12-15 Thread tsunhin wong
Dear R Users, I was running some data analysis scripts and ran into this error: Error: cannot allocate vector of size 27.6 Mb Doing a "memory.size(max=TRUE)" will give me: [1] 1506.812 The current situation is: I'm working on a Windows Vista 32bit laptop with 4GB RAM (effectively 3GB I assume..

[R] Resampling physiological data using R?

2008-12-11 Thread tsunhin wong
Dear all R users, I am going to use R to process some of my physiological data about eye. The problem is the recording machine does not sample in a reliably constant rate: the time intervals between data sampled can vary from 9msec to ~120msec, while most around in the 15-30msec range. The below

Re: [R] Multpile (45x8) graphs of the same page / device: titles crammed

2008-12-10 Thread tsunhin wong
I found I have to use font=1, and I found it works when I set: par(mfcol=c(45,8)) par(mar=c(0,0.5,1,0.5)) instead of par(mfcol=c(45,8)) par(mai=c(0,0,0,0)) On Wed, Dec 10, 2008 at 9:22 AM, tsunhin wong <[EMAIL PROTECTED]> wrote: > What if cex=0.001 with font=1 will still have the title

Re: [R] Multpile (45x8) graphs of the same page / device: titles crammed

2008-12-10 Thread tsunhin wong
>> x <- seq(0, 10) >> >> pdf(width=8, height=20) >> par(mfrow=c(45, 8), mai=c(0,0.1,0.1,0)) >> >> sapply(1:(45*8), function(ii) { >>plot(x, rnorm(x)) >>title(paste("test", ii), cex.main=0.5) >> }) -> b.qu

  1   2   >