[R] question regarding rmvDAG in package pcalg

2014-11-25 Thread Jack Luo
Hi, I am trying to use rmvDAG in pcalg package to generate data from DAG structure. One thing I found is that when the number of variables gets large, there can be really large numbers in the data matrix. I played around with different parameters and it looks like the same case. library(pcalg) >

[R] question regarding pcalg package

2014-09-26 Thread Jack Luo
Hi, I am trying to use the pcalg package to do some causal inference on some high dimensional omics data (~ 30k variables). It takes forever to run and my machine get stuck. I just realized that conditional independence test can be calculated without using the correlation matrix (I think it's just

[R] bias in AUCRF?

2013-11-20 Thread Jack Luo
Hi, I am using the AUCRF package for my data and I was firstly impressed by the high performance of OOB-AUC. But after a while, I feel it might be due to some sort of bias, which motivates me to use random data (generated using rnorm) for a test. The design is very simple: 100 observations with 5

[R] question regarding cv.glmnet in glmnet package

2013-10-23 Thread Jack Luo
Hi, I am using glmnet for my data and have questions regarding cv.glmnet: 1. Is the 10 fold CV stratified cross validation for binary classification problem? 2. I am doing binary classification (family = "binomial"), the plot from cv.glmnet gives the average auc as well as the error bar with dif

[R] question regarding cast function in reshape package with mixture of numeric and character

2013-09-26 Thread Jack Luo
Hi, I am trying to process some data frame with cast function to unwind the stacked variables. I have no problem using cast when the values are all numeric based on the following format: cast(df,subject~v1+v2+v3,value = "value",fun.aggregate = mean, fill = "NA") However, I am getting some tr

[R] how to fit a glm model with all possible interactions between explanatory variables

2013-06-06 Thread Jack Luo
Hi, I am trying to find a way to fit a glm model with all the possible interaction terms between different variables, without typing all the X1:X2, X1:X3, in the formula, is there a way in R to do that? Thanks, -Jack [[alternative HTML version deleted]] ___

[R] question regarding headers with space in the names

2011-08-17 Thread Jack Luo
Hi, After I read an xlsx file into the work space: A <- read.xlsx("B.xls", header = T, check.names = F) There are several headers with the names like: colnames(A) [1:4] # [1] "A 1""B" [3] "C 2" "D" I can get the content of column 2 and column 4 eas

Re: [R] question regarding gregexpr and read.table

2011-08-17 Thread Jack Luo
so mask it or don't use regular expressions: > > gregexpr("[.]","A.B.C.D") #or > gregexpr(".","A.B.C.D",fixed=T) > > cheers. > > Am 17.08.2011 15:03, schrieb Jack Luo: > > Hi, > > > > I have a silly question regardin

[R] question regarding gregexpr and read.table

2011-08-17 Thread Jack Luo
Hi, I have a silly question regarding the usage of two commands: read.table and gregexpr: For read.table, if I read a matrix and set header = T, I found that all the dash ("-") becomes dots (".") A = read.table("Matrix.txt", sep = "\t", header = F) A[1,1] # "A-B-C-D". A = read.table("Matrix.t

[R] how to convert a unix R package to windows installable zip file?

2010-08-24 Thread Jack Luo
Hi, I downloaded a package with .gz extension, which presumably works for Unix, when I installed it directly on windows, it has the error msg: Error in gzfile(file, "r") : cannot open the connection In addition: Warning messages: 1: In unzip(zipname, exdir = dest) : error 1 in extracting from zip

Re: [R] question about SVM in e1071

2010-07-28 Thread Jack Luo
ne my adding more SV ( till we get a convex hull of the data ) > > hope it helps > Regards > Pau > > 2010/7/14 Jack Luo > >> Pau, >> >> Thanks a lot for your email, I found it very helpful. Please see below for >> my reply, thanks. >> >> -Jac

Re: [R] question about SVM in e1071

2010-07-14 Thread Jack Luo
s(m1[m1[,3]>0,1], m1[m1[,3]>0,2], pch=3, col="green") > points(m1[m1[,3]<0,1], m1[m1[,3]<0,2], pch=4, col="blue") > points(model.svm$SV[,1],model.svm$SV[,2], pch=18 , col = "red") > } > * > * *Thanks a lot for the code, I really appreciate it

[R] question about SVM in e1071

2010-07-13 Thread Jack Luo
Hi, I have a question about the parameter C (cost) in svm function in e1071. I thought larger C is prone to overfitting than smaller C, and hence leads to more support vectors. However, using the Wisconsin breast cancer example on the link: http://planatscher.net/svmtut/svmtut.html I found that th

Re: [R] how to display the clock time in the loop

2010-07-07 Thread Jack Luo
; Try to flush output after printing: > > cat(paste(Sys.time()),"\n"); flush(stdout()) > > On Thu, 2010-07-01 at 16:17 -0400, Jack Luo wrote: > > Hi, > > > I am doing some computation which is pretty time consuming, I want R to > > display CPU time after each it

[R] how to display the clock time in the loop

2010-07-01 Thread Jack Luo
Hi, I am doing some computation which is pretty time consuming, I want R to display CPU time after each iteration using the command Sys.time(). However, I found that the code only began to display the CPU time after quite a while and several iterations have finished. Is there a way to ask R to dis

Re: [R] how to plot only the upper triangle using the pairs function?

2010-03-12 Thread Jack Luo
On Mar 12, 2010, at 10:09 AM, Jack Luo wrote: > > > Hi, > > > > I am trying to use function pairs to plot the scatterplot, but I only > want > > to keep the upper triangle, what's the argument to do this? > > > > Thanks, > > > > -Jack &

[R] how to plot only the upper triangle using the pairs function?

2010-03-12 Thread Jack Luo
Hi, I am trying to use function pairs to plot the scatterplot, but I only want to keep the upper triangle, what's the argument to do this? Thanks, -Jack [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.et

Re: [R] fitting a logistic regression with mixed type of variables

2009-11-16 Thread Jack Luo
PM, David Winsemius wrote: > > On Nov 16, 2009, at 2:22 PM, Jack Luo wrote: > > Hi, >> >> I am trying to fit a logistic regression using glm, but my explanatory >> variables are of mixed type: some are numeric, some are ordinal, some are >> categorical, say >&

[R] fitting a logistic regression with mixed type of variables

2009-11-16 Thread Jack Luo
Hi, I am trying to fit a logistic regression using glm, but my explanatory variables are of mixed type: some are numeric, some are ordinal, some are categorical, say If x1 is numeric, x2 is ordinal, x3 is categorical, is the following formula OK? *model <- glm(y~x1+x2+x3, family=binomial(link="l

[R] how to suppress the output from stepAIC?

2009-11-10 Thread Jack Luo
Hi, I am now running a cross-validation using coxph coupled with stepAIC for model selection, is there anyway to suppress the output? It's too much. -Jack [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.e

[R] what's the R command to make the following?

2009-06-22 Thread Jack Luo
Hi, I have a simple question, suppose I have the date "05/16/2008", what would be the command to get the month, day and year? Thanks, -Jack [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman

[R] simple question on glm

2009-06-18 Thread Jack Luo
Hi, I am trying to use glm to fit my data, wondering if there is a easy way to fit a glm without typing all the explanatory variable names. For example, if I have 100 explanatory variables x1, x2, ..., x100 and response variable is y, I don't want to do something like glm1 <- glm(y ~ x1 + x2 + ...

[R] Can elastic net do binary classification?

2008-12-09 Thread Jack Luo
Hi, List The elastic net package (by Hastie and Zou at Stanford) is used to do regularization and variable selection, it can also do regression. I am wondering if it can perform binary classification (discrete outcome). Anybody having similar experience? Many thanks, -Jack [[alternative

[R] how to use different variable to store values with different length in a loop

2008-01-18 Thread Jack Luo
Hi, List I am trying to use variables named A1, A2, ..., A100 to store some values, each variable could store some values with different length, how can I achieve this? Thanks, Jack [[alternative HTML version deleted]] __ R-help@r-project.org

[R] how to go to a line in R

2008-01-14 Thread Jack Luo
Hi, List When I was writing R code, I notice that there is no number indicating how many lines of codes you are writing. Is there a way to go to a line with defined number? say I want to go to the 20th line. Thanks, Jack [[alternative HTML version deleted]]

Re: [R] question on how to extract values from atomic vector

2008-01-10 Thread Jack Luo
gt; $dimnames[[1]] > NULL > > $dimnames[[2]] > [1] "a" "pi" > > > > attributes(x)$dim > [1] 3 2 > > attr(x, 'dim') > [1] 3 2 > > > > So in your case, > > attr(Results, 'prob') > > or > > attribu

[R] question on how to extract values from atomic vector

2008-01-09 Thread Jack Luo
Dear List, I have an atomic vector named "Results" Results [1] 1 1 1 attr(,"prob") [1] 0.667 1.000 1.000 Levels: 0 1 when I type attributes(Results) $levels [1] "0" "1" $class [1] "factor" $prob [1] 0.667 1.000 1.000 However, when I type Results$prob It has the follo

[R] detailed calculation of two way anova with unbalanced design

2007-12-14 Thread Jack Luo
Dear list, Could someone show me where can I find the detailed formula on how to calculate the two way anova with unbalanced design? Say, if I have 2*2 design with 10,20,30,40 samples in each of the 2*2 cells. Most of the places I've googled only show how to calculate using software such as R, but

Re: [R] low level plotting question on R

2007-12-07 Thread Jack Luo
2007 12:33 PM, Roland Rau <[EMAIL PROTECTED]> wrote: > Hi Jack, > > Jack Luo wrote: > > Dear List, > > > > I am trying to modify the xlab and ylab for a current figure that was > > plotted by a package, I searched through the low level plotting command >

[R] low level plotting question on R

2007-12-07 Thread Jack Luo
Dear List, I am trying to modify the xlab and ylab for a current figure that was plotted by a package, I searched through the low level plotting command and they do not seem to contain how to do this (the only way is to use xlab, ylab as arguments in "plot" command, which I can not do since the pl