Re: [R] package.skeleton()

2011-12-19 Thread steven mosher
Here ben I have a tutorial on how to do it http://stevemosher.wordpress.com/step-8-the-sample-package/ On Sun, Dec 18, 2011 at 11:49 PM, Petr PIKAL petr.pi...@precheza.cz wrote: Hi If I remember correctly I do start clear R -vanilla session copy my functions to it. run

[R] Calculating the probability of an event at time t from a Cox model fit

2011-12-19 Thread aajit75
Dear R-users, I would like to determine the probability of event at specific time using cox model fit. On the development sample data I am able to get the probability of a event at time point(t). I need probability score of a event at specific time, using scoring scoring dataset which will have

[R] Boot: Confidence Interval

2011-12-19 Thread Vikram Bahure
Dear R users, I have a very simple query. I am using bootstrap (library(boot)). I want to access the std. error in the results and further generate confidence interval(CI) for n no. of samples which will give me n values for std. error and CI. * * b1 ORDINARY NONPARAMETRIC BOOTSTRAP Call:

[R] None-linear equality constrained optimisation problems

2011-12-19 Thread Michael Griffiths
Dear R users, I have a problem. I would like to solve the following: I have pL = 1/(1+e^(-b0+b1)) pM = 1/(1+e^(-b0)) pH = 1/(1+e^(-b0-b1)) My target function is TF= mean(pL,pM,pH) which must equal 0.5% My non-linear constraint is nl.Const = 1-(pM/pH), which must equal 20%, and would like

[R] Mlogit missing value problem

2011-12-19 Thread Ville Iiskola
Hi After good advices i post this problem here again. Now the attached sambledata is in csv form and it is a part of my real data. I have tried different na.action operations but the result stays the same... My code library(mlogit) library(foreign) z-odbcConnectExcel(D:\\SAMBLEDATA.csv)

[R] block averaging data frames

2011-12-19 Thread Mathew Brown
Hi there, This seems like it should be simple. I have a data frame of climate data sampled every 10 min. I want to average the entire data frame into 30 min values (i.e., one value for each half hour). Functions like running.mean give me a moving average but I want to reduce the size of

Re: [R] Boot: Confidence Interval

2011-12-19 Thread Prof Brian Ripley
On 19/12/2011 09:12, Vikram Bahure wrote: Dear R users, I have a very simple query. I am using bootstrap (library(boot)). I want to access the std. error in the results and further generate confidence interval(CI) for n no. of samples which will give me n values for std. error and CI. * * b1

Re: [R] Mlogit missing value problem

2011-12-19 Thread K. Elo
Hi, 19.12.2011 11:12, Ville Iiskola wrote: Error in if (abs(x - oldx) ftol) { : missing value where TRUE/FALSE needed The reason for this error is in the row 563. There the choice has value 1 and Ie has missing value. If the choice has value 0 and Ie has missing values, then there is no

[R] fractal image analysis

2011-12-19 Thread Petr PIKAL
Dear all I tried to find some packages (or programs) for image analysis and especially fractal dimension image analysis but so far I had not success. It shall be used for particle surface layer analysis from TEM images. Any suggestions? Best regards Petr

Re: [R] None-linear equality constrained optimisation problems

2011-12-19 Thread Berend Hasselman
Michael Griffiths wrote Dear R users, I have a problem. I would like to solve the following: I have pL = 1/(1+e^(-b0+b1)) pM = 1/(1+e^(-b0)) pH = 1/(1+e^(-b0-b1)) My target function is TF= mean(pL,pM,pH) which must equal 0.5% My non-linear constraint is nl.Const =

Re: [R] calculating correlation coefficients on repeated measures

2011-12-19 Thread Sarah Goslee
Hi Keith, You do need to reorganize your data. cor() will work on any number of variables as long as they are columns in a matrix or data frame. There are a lot of ways to reorganize data, of various power and complexity. Here's one simple way: library(ecodist) WW_Sample_table -

Re: [R] fractal image analysis

2011-12-19 Thread Sarah Goslee
Hi, I've always used FRAGSTATS, but it looks like the SDMTools package will do it within R. Sarah On Mon, Dec 19, 2011 at 4:56 AM, Petr PIKAL petr.pi...@precheza.cz wrote: Dear all I tried to find some packages (or programs) for image analysis and especially fractal dimension image analysis

Re: [R] write.xls dont find the object in function

2011-12-19 Thread Ronaldo Reis Júnior
Em 18-12-2011 18:55, Rolf Turner escreveu: On 19/12/11 04:29, Uwe Ligges wrote: On 18.12.2011 12:58, Ronaldo Reis Júnior wrote: SNIP Why the write.xls dont find the object a inside a function? Because at least that part of the function is poorly written. Surely this should be a fortune!

Re: [R] block averaging data frames

2011-12-19 Thread jim holtman
Does this work for you: x - read.table(text = date time Voltage LwTempDownelling LwDownwelling LwDownwelling_min LwDownwelling_max LwTempUpwelling + 1 2011-11-01 00:00:00 2.73244717.30 30.0 14.0 39.5 17.83 + 2 2011-11-01 00:10:00 2.731534

Re: [R] Label in oblique orientation

2011-12-19 Thread Komine
Hi, Thank you David, I resolved the problem with ?text. Komine -- View this message in context: http://r.789695.n4.nabble.com/Label-in-oblique-orientation-tp4211944p4213465.html Sent from the R help mailing list archive at Nabble.com. __

[R] Global model more parsimonious (minor QAICc)

2011-12-19 Thread lincoln
Hi all, I know this a general question, not specific for any R package, even so I hope someone may give me his/her opinion on this. I have a set of 20 candidate models in a binomial GLM. The global model has 52 estimable parameters and sample size is made of about 1500 observations. The global

[R] rendering or raytracing?

2011-12-19 Thread skan
Hello Is there any package for rendering or raytracing? -- View this message in context: http://r.789695.n4.nabble.com/rendering-or-raytracing-tp4213944p4213944.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org

[R] Hausman test for lmer model

2011-12-19 Thread arunkumar1111
Hi How to perform hausman test when a model is created using lmer ? Also please any one give link to mail it to r-sig-mixed-models mailing list. I'm not able to find it Thanks in advance Arun -- View this message in context:

[R] fUnitRoots cannot obtain p.value

2011-12-19 Thread michalseneca
Hi , I have issue obtaining p.value in urersTest(x, type = c(DF-GLS, P-test),lag.max = 4,doplot = FALSE)@test$p.value urersTest(...)@test indicates correct results but upon obtaining p.value as this the result is NULL. Which seems not to be correct . Any help on this ? Mike -- View this

Re: [R] Inquiry about matrix pooling

2011-12-19 Thread Jean V Adams
Jana Makedonska wrote on 12/14/2011 07:19:23 PM: Dear R-users, I am a relatively new R user and I have a simple question. Is there a command attached to a R function, which performs matrix pooling? Thanks in advance, Jana -- -- The world is full of mysteries. Life is one.

Re: [R] Trouble converting hourly data into daily data

2011-12-19 Thread Jean V Adams
Sean Baumgarten wrote on 12/14/2011 06:38:08 PM: Hello, I have a data frame with hourly or sub-hourly weather records that span several years, and from that data frame I'm trying to select only the records taken closest to noon for each day. Here's what I've done so far: #Add a column

Re: [R] rendering or raytracing?

2011-12-19 Thread Duncan Murdoch
On 19/12/2011 7:54 AM, skan wrote: Hello Is there any package for rendering or raytracing? The rgl package uses OpenGL for rendering solid objects, but it doesn't do raytracing. A nice addition would be to output a scene in a format that some external ray-tracer (e.g. POV-ray) could

[R] summary vs anova

2011-12-19 Thread Brent Pedersen
Hi, I'm sure this is simple, but I haven't been able to find this in TFM, say I have some data in R like this (pasted here: http://pastebin.com/raw.php?i=sjS9Zkup): head(df) gender age smokes diseaseY 1 female 65 ever control 0.18 2 female 77 never control 0.12 3 male 40

Re: [R] block averaging data frames

2011-12-19 Thread Mathew Brown
Hmm, almost but my real data frame is much larger (128 columns). The problem is with this line newData - do.call(rbind, tapply(x[4:8], x$interval, colMeans)) when I do tapply(x[4:8], x$interval, colMeans) all works but when I do tapply(x[4:7], x$interval, colMeans) I get Error in

Re: [R] block averaging data frames

2011-12-19 Thread Mathew Brown
Almost except tapply(x[4:8], x$interval, colMeans) works but with a larger data frame I have problems, even tapply(x[4:7], x$interval, colMeans) gets the arguments must have the same length error. But they do! Any ideas? Thanks for your help Jim On 12/19/2011 2:00 PM, jim holtman wrote:

Re: [R] summary vs anova

2011-12-19 Thread David Winsemius
On Dec 19, 2011, at 9:09 AM, Brent Pedersen wrote: Hi, I'm sure this is simple, but I haven't been able to find this in TFM, say I have some data in R like this (pasted here: http://pastebin.com/raw.php?i=sjS9Zkup): One of the reason this is not in TFM is that these are questions that

Re: [R] Calculating the probability of an event at time t from a Cox model fit

2011-12-19 Thread David Winsemius
On Dec 19, 2011, at 3:34 AM, aajit75 wrote: Dear R-users, I would like to determine the probability of event at specific time using cox model fit. On the development sample data I am able to get the probability of a event at time point(t). I need probability score of a event at specific

Re: [R] summary vs anova

2011-12-19 Thread peter dalgaard
On Dec 19, 2011, at 15:09 , Brent Pedersen wrote: Hi, I'm sure this is simple, but I haven't been able to find this in TFM, It's not _that_ simple. You likely need TFtextbook rather than TFM. Most (but not all) will go into at least some detail of coding categorical variables using dummy

Re: [R] write.xls dont find the object in function

2011-12-19 Thread Uwe Ligges
On 19.12.2011 13:30, Ronaldo Reis Júnior wrote: Em 18-12-2011 18:55, Rolf Turner escreveu: On 19/12/11 04:29, Uwe Ligges wrote: On 18.12.2011 12:58, Ronaldo Reis Júnior wrote: SNIP Why the write.xls dont find the object a inside a function? Because at least that part of the function

Re: [R] problem with tick graph

2011-12-19 Thread Jean V Adams
n.via...@libero.itg wrote on 12/16/2011 05:02:24 AM: Dear all, I'm having problems with the tick of my graph. I'mpcombining lines and barplot. For my I'm using the function axis combined with the function pretty to have more efficient tick, but all my tick (for example, 300 as my max

[R] Training parameters for a HMM

2011-12-19 Thread Claus O'Rourke
Hi, I'm a newbie to the world of HMMs and HMMs in R. I've had a look at the hmm package and the RHmm package but I couldn't see anything straightforward on how a labelled sequential dataset with observed values and underlying states might be used to construct and train a HMM based on that data and

Re: [R] Training parameters for a HMM

2011-12-19 Thread Ingmar Visser
Claus, Given that you have observed the hidden states they are not really hidden anymore ... so maybe an HMM is not what you are looking for. Assuming that you had such super observation powers using something like: by(obs,hid,table) will get you the state dependent counts of the categories of

[R] Summing x1 to x6

2011-12-19 Thread Pablo
Suppose I have the following: x1-as.vector(rnorm(10)) x2-as.vector(rnorm(10)) x3-as.vector(rnorm(10)) x4-as.vector(rnorm(10)) x5-as.vector(rnorm(10)) x6-as.vector(rnorm(10)) x7-as.vector(rnorm(10)) x8-as.vector(rnorm(10)) x9-as.vector(rnorm(10)) x10-as.vector(rnorm(10)) I would like the mean of

Re: [R] rendering or raytracing?

2011-12-19 Thread skan
Hi Then OK, I mean raytracing directly with some R package. Or maybe some optics package I've seen there exist an optics package called planar but it's only for reflection and transmission at planar interfaces. -- View this message in context:

[R] How to schedule R to run automatically

2011-12-19 Thread Kenneth Zhang
I'd like to run an R code automatically on Windows 7, say once every 2 hours. Could anyone tell me how to manage it? Thanks in advance! Best regards, Ken [[alternative HTML version deleted]] __ R-help@r-project.org mailing list

Re: [R] Summing x1 to x6

2011-12-19 Thread jim holtman
Not sure what you mean by mean of each position, so here are two possibilities: rowMeans and colMeans: x1-as.vector(rnorm(10)) x2-as.vector(rnorm(10)) x3-as.vector(rnorm(10)) x4-as.vector(rnorm(10)) x5-as.vector(rnorm(10)) x6-as.vector(rnorm(10)) x7-as.vector(rnorm(10))

Re: [R] How to schedule R to run automatically

2011-12-19 Thread jim holtman
That is what the task scheduler is for. Just create a .bat file that invokes R and schedule it every two hours. On Win XP it is Control Panel/Scheduled Tasks. On Mon, Dec 19, 2011 at 11:10 AM, Kenneth Zhang kenneth...@gmail.com wrote: I'd like to run an R code automatically on Windows 7, say

Re: [R] Summing x1 to x6

2011-12-19 Thread David Winsemius
On Dec 19, 2011, at 11:00 AM, Pablo wrote: Suppose I have the following: x1-as.vector(rnorm(10)) x2-as.vector(rnorm(10)) x3-as.vector(rnorm(10)) x4-as.vector(rnorm(10)) x5-as.vector(rnorm(10)) x6-as.vector(rnorm(10)) x7-as.vector(rnorm(10)) x8-as.vector(rnorm(10)) x9-as.vector(rnorm(10))

[R] Constrained Optimisation

2011-12-19 Thread Russell2
Dear All I have a constrained optimisation problem, I want to maximise the following function t(weights) %*% CovarianceMatrix %*% weights for the weights, subject to constraints on each element within the weights the weights vector summing to 1. i.e. weights = (x1, x2, x3), where x1 is

[R] nlrob problem

2011-12-19 Thread Pascal A. Niklaus
Dear all, I am not sure if this mail is for R-help or should be sent to R-devel instead, and therefore post to both. While using nlrob from package 'robustbase', I ran into the following problem: For psi-functions that can become zero (e.g. psi.bisquare), weights in the internal call to

Re: [R] fractal image analysis

2011-12-19 Thread Andrés Aragón
Dear Petr, Well, It is not R but works well: Fractal dimension and lacunarity a plugin for ImageJ. Best regards, Andrés AM * * 2011/12/19 Sarah Goslee sarah.gos...@gmail.com Hi, I've always used FRAGSTATS, but it looks like the SDMTools package will do it within R. Sarah On Mon, Dec

[R] pls help to print out first row of terms(model) output in example program

2011-12-19 Thread Paul Johnson
Greetings. I've written a convenience function for multicollinearity diagnosis. I'd like to report to the user the formula that is used in a regression. I get output like this: mcDiagnose(m1) [1] The following auxiliary models are being estimated and returned in a list: [1] `x1` ~ .

Re: [R] pls help to print out first row of terms(model) output in example program

2011-12-19 Thread William Dunlap
Does applying formula() to the output of lm() (or terms()) do what you want? d - data.frame(y=1:10, x1=log(1:10), x2=sqrt(1:10), x3=1/(1:10)) formula(lm(formula(y~.), data=d)) # dot expanded y ~ x1 + x2 + x3 lm(formula(y~.), data=d)$call[[2]] # your original formula(y~.)

Re: [R] rendering or raytracing?

2011-12-19 Thread baptiste auguie
Hi, package planar is concerned with the full electromagnetic problem at planar interfaces, which is not very useful for raytracing. The cda package includes a small demo interfacing either rgl or povray (via system call) to visualize 3D clusters of metallic particles. A more general interface to

Re: [R] Polygon

2011-12-19 Thread Jim Lemon
Komine wrote: Hi everybody, I have a matrix with 3 columns (Date, MeanArea and SdArea). I want to draw a figure showing the variable MeanArea in terms of the Date. But instead to use the variable SdArea as bar error, I want to use “polygon error”. I use this code but the output does not seem

[R] On Corrections for Chi-Sq Goodness of Fit Test

2011-12-19 Thread Michael Fuller
TOPIC My question regards the philosophy behind how R implements corrections to chi-square statistical tests. At least in recent versions (I'm using 2.13.1 (2011-07-08) on OSX 10.6.8.), the chisq.test function applies the Yates continuity correction for 2 by 2 contingency tables. But when used

Re: [R] Color2D.matplot uniform color range

2011-12-19 Thread Jim Lemon
On 12/13/2011 02:15 AM, jalfaro wrote: Hi Jim, Thanks so much for your help. I have read several of your responses on this mailing list and they have helped me out quite a bit as I have gotten more and more used to R. I am still a little confused here by your response. I think you understood my

Re: [R] Constrained Optimisation

2011-12-19 Thread Florent D.
try the lsei function from the limSolve package. On Mon, Dec 19, 2011 at 2:32 PM, Russell2 bhargavaos...@hotmail.co.uk wrote: Dear All I have a constrained optimisation problem, I want to maximise the following function t(weights) %*% CovarianceMatrix %*% weights for the weights,

Re: [R] Summing x1 to x6

2011-12-19 Thread Florent D.
I tried to be clever by trying get(paste(paste(x, 1:6, sep=), collapse=+)) but it didn't work. Maybe you meant something like this: sapply(paste(x, 1:6, sep=), function(x)mean(get(x))) On Mon, Dec 19, 2011 at 2:30 PM, David Winsemius dwinsem...@comcast.net wrote: On Dec 19, 2011, at 11:00

Re: [R] How to schedule R to run automatically

2011-12-19 Thread Agus MS
I don't know if this code match what you want. You should use tcltk library. code: library(tcltk) z - function () { cat(Hello you!\n); .id - tcl(after, 1000, z)} z() If you want to cancel you can use: .id - tcl(after, 1000, z) tcl(after, info, .id) # To get info about this scheduled task

[R] predict risk (% of death) at a certain time point

2011-12-19 Thread Bill Hyman
Dear all, Does any one know how to calculate the risk (death rate) at some time point (say 5 yrs) based on Kaplan-Meier curve in coxph model in R? I know how to fit the survival data with coxph. But need to calculate risk at some time point. Many thanks. Bill

Re: [R] predict risk (% of death) at a certain time point

2011-12-19 Thread David Winsemius
On Dec 19, 2011, at 10:05 PM, Bill Hyman wrote: Dear all, Does any one know how to calculate the risk (death rate) at some time point (say 5 yrs) based on Kaplan-Meier curve in coxph model in R? I know how to fit the survival data with coxph. But need to calculate risk at some time

[R] replacement has 13665 rows, data has 13664

2011-12-19 Thread Nicole Marie Ford
Hello, all. I have come across a problem. Previously, when I recoded my DV, added the variable to my dataset and ran the multinom, I was just fine. But I am doing it again and I am getting this error. R Poland$trust - trust Error in `$-.data.frame`(`*tmp*`, trust, value = c(NA, NA, NA, NA,

[R] boot.ci: [Error: cannot allocate vector of size 1.5 Gb]

2011-12-19 Thread Vikram Bahure
Dear R users, I am getting following error while using boot.ci. I have int.inc function with 2 values. I am generating CI for the sample estimate. * med - function(x,i) median(x[i])* * b1 - boot(int.inc,med,2)* * ci.out - boot.ci(b1,conf = c(0.95),type = c(bca))* *Error: cannot

[R] column permutation of sparse matrix

2011-12-19 Thread khai
Hi, I'm very new to working with sparse matrices and would like to know how I can column permute a sparse matrix. Here is a small example: M1 - spMatrix(nrow=5,ncol=6,i=sample(5,15,replace=TRUE),j=sample(6,15,replace=TRUE),x=round_any(rnorm(15,2),0.001)) M1 5 x 6 sparse Matrix of class

Re: [R] Constrained Optimisation

2011-12-19 Thread Enrico Schumann
This looks much like the kinds of problems that function 'solve.QP' in package 'quadprog' can handle. But if you want people to help you, follow the posting guide and 'provide commented, minimal, self-contained, reproducible code'. You need to show people what you tried and how it failed (so