[R] degrees of freedom question

2007-08-22 Thread Greg Tarpinian
R2.3, WinXP Dear all, I am using the following functions: f1 = Phi1+(Phi2-Phi1)/(1+exp((log(Phi3)-log(x))/exp(log(Phi4))) f2 = Phi1+(Phi2-Phi1)/(1+exp((log(Phi3)-log(r)-log(x))/exp(log(Phi4))) subject to the residual weighting Var(e[i]) = sigma^2 * abs( E(y) )^(2*Delta) Here is my

Re: [R] apply( )

2007-05-11 Thread Greg Tarpinian
Thank you all for your answers... To summarize, 1. with(X, ifelse(V1 V2 | V1 V3, 1, 0)) 2. ifelse((foo$x foo$y) | (foo$x foo$z), 1, 0) 3. with(foo, (x y) * (x z)) were the responses to my question (see below). Kindly, Greg --- Original post --- I have a

[R] apply( )

2007-05-10 Thread Greg Tarpinian
I have a question that must have a simple answer (but eludes me). I need a row-by-row logical comparison across three numeric variables in a data frame: foo$x, foo$y, foo$z. The logic is if( x y || x z ) 1 else 0 for a particular row. It is simple and very inefficient to use for(i in

[R] PROC DISCRIM vs. lda( ) in MASS

2007-04-17 Thread Greg Tarpinian
Hello, I am using WinXP, R version 2.3.1, and SAS for PC version 8.1. I have mostly used SAS over the last 4 years and would like to compare the output of PROC DISCRIM to that of lda( ) with respect to a very specific aspect. My data have k=3 populations and there are 3 variates in the feature

[R] 4PL algorithm

2006-10-12 Thread Greg Tarpinian
WinXP, Splus7 and R2.3.1. All, I have been using the SSfpl and SSlogis self-starting functions in the nlme library to fit 4PL and restricted 4PL models. I need to adapt these routines to fit the alternative model f(x) = A + (B-A)/(1 + abs(x/EC50)^C) My Question: How do I obtain good

[R] searching for data.frame rows / processing of rows

2006-10-04 Thread Greg Tarpinian
R 2.3.1, WinXP: I have a puzzling problem that I suspect may be solved using grep or a regular expression but am at a loss how to actually do it... My data.frame looks like Location TimeXY --- --- 1 0 1.6 9.3 1 3 4.2 10.4 1

[R] curve peeling

2006-05-26 Thread Greg Tarpinian
R2.3.0, WinXP. I am trying to fit the model Y(t) = C1*exp(-exp(a)*t) + C2*exp(-exp(b)*t) - (C1+C2)*exp(-exp(c)*t) to some pharmacokinetic data. The data derives from a single oral dose of a drug. Does anyone know how to use peeling and/or other methods to obtain good starting estimates of

[R] nlminb( ) : one compartment open PK model

2006-04-20 Thread Greg Tarpinian
All, I have been able to successfully use the optim( ) function with L-BFGS-B to find reasonable parameters for a one-compartment open pharmacokinetic model. My loss function in this case was squared error, and I made no assumptions about the distribution of the plasma values. The model

[R] trellis graph question

2006-03-28 Thread Greg Tarpinian
R2.2, WinXP: I am using xyplot( ) to generate time plots of plasma concentration data. The following is an edited version of my code: xyplot(log.conc ~ time| group, data = foo, groups = subject, panel = function(x, y, panel.number, ...) { panel.superpose(x, y,

[R] autoloading .RData files / .Rhistory file

2006-03-16 Thread Greg Tarpinian
NOTE: WinXP, R2.2.0 All, a while back I posted a question about using relative filereferencing. The responses have allowed me to successfully set up the following directory structure: ...\data\raw ...\data\derived ...\prog ...\lst ...\log In the \prog directory I have put

Re: [R] relative referencing for filenames etc

2006-02-28 Thread Greg Tarpinian
: On Tue, 28 Feb 2006, Uwe Ligges wrote: On Mon, 27 Feb 2006, Greg Tarpinian wrote: BACKGROUND: I use SAS on a daily basis and one of its most powerful features in a production environment is the use of LIBNAME and FILEREF statements, e.g.: PROC PRINTTO LOG = LOGDIR.\data

[R] relative referencing for filenames etc

2006-02-27 Thread Greg Tarpinian
BACKGROUND: I use SAS on a daily basis and one of its most powerful features in a production environment is the use of LIBNAME and FILEREF statements, e.g.: PROC PRINTTO LOG = LOGDIR.\data processing.log NEW; RUN; PROC IMPORT DATAFILE= DATADIR.\blah.xls OUT = TEMP DBMS =

[R] lme in R (WinXP) vs. Splus (HP UNIX)

2006-01-30 Thread Greg Tarpinian
R2.2 for WinXP, Splus 6.2.1 for HP 9000 Series, HP-UX 11.0. I am trying to get a handle on why the same lme( ) code gives such different answers. My output makes me wonder if the fact that the UNIX box is 64 bits is the reason. The estimated random effects are identical, but the fixed effects

[R] panel.xyplot : incorrectly connecting points

2006-01-25 Thread Greg Tarpinian
R 2.2, WinXP. I am having problems getting the right kind of xyplot( ) to be generated. The first of these works fine, but doesn't overlay a reference grid (which I need): xyplot(Y ~ X | Factor1, type = 'b', groups = GROUP, col = c(1,13), pch = c(16,6), lty = 1, lwd = 2, cex = 1.2, data =

Re: [R] Plotting an lme( ) object

2006-01-19 Thread Greg Tarpinian
, by GROUP, between = list(x = .5, y = .5)) Using paste() to hardcode an extra space provided me with the necessary graphical offsets. Regards, Greg --- Deepayan Sarkar [EMAIL PROTECTED] wrote: On 1/19/06, Henric Nilsson [EMAIL PROTECTED] wrote: Greg Tarpinian said the following

[R] Plotting an lme( ) object

2006-01-18 Thread Greg Tarpinian
R for Windows, version 2.2. I am trying the following code: BLAH.lme4 - lme(fixed = , data = , random = ) plot(BLAH.lme4, resid(.,type = p) ~ fitted(.) | GROUP, id = 0.05, adj = -0.3, idLabels = BLAH$VALUE, main = Pearson Residuals vs. Fitted Values, by Group) When

[R] Plotting an lme( ) object

2006-01-18 Thread Greg Tarpinian
I apologize for the second posting, my other email address died today. I am using R for Windows, version 2.2. Here is my code: plot(FOO.lme4, resid(.,type = p) ~ fitted(.) | LOT, id = 0.05, adj = -0.3, idLabels = RO54F$VALUE, main = Pearson Residuals vs.

[R] Plotting an lme( ) object

2006-01-18 Thread Greg Tarpinian
I apologize for the second posting, my other email address died today. I am using R for Windows, version 2.2. Here is my code: plot(FOO.lme4, resid(.,type = p) ~ fitted(.) | GROUP, id = 0.05, adj = -0.3, idLabels = FOO$value, main = Pearson Residuals vs. Fitted Values,

[R] contrast {Design} question

2005-08-05 Thread Greg Tarpinian
All, I have been trying to get the following code to work: A.quantiles - quantile(foo.frame$A, probs = seq(from = 0.05, to = 0.95, by = 0.05)) base.quantiles - quantile(Efficacy205$BASELINE_RANK, probs = seq(from = 0.05, to = 0.95, by = 0.05)) gender - levels(Efficacy205$GENDER) contrast.1 -

[R] contrast {Design} question

2005-08-05 Thread Greg Tarpinian
Sorry about the previous email, hadn't finished editing yet Here is some code that I have been trying to get to work: A.quant - quantile(foo.frame$A, probs=seq(from=0.05, to=0.95, by=0.05)) B.quant - quantile(foo.frame$B, probs=seq(from=0.05, to=0.95, by=0.05)) gender -

[R] Hmisc / Design question

2005-08-02 Thread Greg Tarpinian
All, I have been reading Dr. Harrell's excellent Regression Modeling Strategies book and trying out the exercises. I understand that contrast( ) is used to obtain contrasts between two variables for given levels of other nuisance variables; is there a way to use contrast( ) to obtain, for

[R] persp( ) Question

2005-05-06 Thread Greg Tarpinian
I have successfully fitted the model loess.fit1 - loess(response ~ X*Y) and plotted it in 3D using X.grid - seq(0,10,length=100) Y.grid - seq(0,1000,length=100) pred.loess1 - predict(loess.fit1, expand.grid(x = X.grid, y = Y.grid)) persp(X.grid, Y.grid, pred.loess1, theta = 0, phi

[R] Constrained Nelder-Mead

2005-03-17 Thread Greg Tarpinian
All, In looking at `optim', it doesn't appear that it is possible to impose nonlinear constraints on Nelder- Mead. I am sufficiently motivated to try to code something in C from scratch and try to call it from R Does anyone have some good references to barrier and/or penalization methods

[R] Modeling censored binomial / Poisson data

2004-11-24 Thread Greg Tarpinian
I have some count data (0 - 1 at each time point for each test subject) that I would like to model. Since the 1's are rather sparse, the Poisson distribution comes to mind but I would also consider the binomial. The data are censored as the data come from a clinical trial and subjects were able

[R] NLME plottting and Confidence Intervals

2004-11-18 Thread Greg Tarpinian
All, I have been learning about mixed models and have been able to successfully use lme( ) and nlme( ) to fit some simple linear and 4PL logistic models. As a relative newbie I am at a loss as to how I can do the following: (1) Import a SAS dataset with DATE9. formatted time values and get

Re: [R] Performing regression using R C

2004-11-18 Thread Greg Tarpinian
I have found Numerical Recipes in C to be extremely helpful in my statistical studies. OLS is described in detail in this book. Best, Greg --- Manoj - Hachibushu Capital [EMAIL PROTECTED] wrote: Dear All, Is it possible to perform OLS using C code? I am trying to optimize a

[R] outlier tests

2004-06-30 Thread Greg Tarpinian
I have been learning about some outlier tests -- Dixon and Grubb, specifically -- for small data sets. When I try help.start() and search for outlier tests, the only response I manage to find is the Bonferroni test avaiable from the CAR package... are there any other packages the offer outlier

Re: [R] SCO R

2004-05-27 Thread Greg Tarpinian
Actually, it was very recent. I pulled the electronic version of the article from the Forbes website: Has SCO's Stance Slowed Linux's Momentum? Arik Hesseldahl, 04.20.04, 3:00 PM ET NEW YORK - The open-source Linux operating system may be mostly free, but there is company that thinks that if

[R] SUMMARY: Using R's LAPACK Related files in Visual C++

2004-03-26 Thread Greg Tarpinian
The following were the replies to my question about using R's LAPACK and other .h files in some of my C programs. From what was said, it appears that buying a ready-made library (MKL = $200, for example) or using CLapack according to the Shumway lecture notes are the best approaches:

[R] Using R's LAPACK Related files in Visual C++

2004-03-25 Thread Greg Tarpinian
I am a relative newcomer to both the R and C/C++ software worlds -- I'm taking a C Programming class currently. I noticed the other day that the C:\Program Files\R1_8_1\src\include\R_ext directory on my WinXP box has the header files BLAS.h Lapack.h Linpack.h RLapack.h I am interested in

[R] Using R's LAPACK Related files in Visual C++

2004-03-25 Thread Greg Tarpinian
header files are on one another? Are they redundant in any way? Which ones would be recommended? Any help / advice would be greatly appreciated. = Greg Tarpinian San Diego, CA __ [EMAIL PROTECTED] mailing list https