[R] R2WinBUGS

2014-12-22 Thread thanoon younis
Dear all R-members I have a problem with R when i wanted to call WinBUGS from R as following: #Call WinBUGS model<-bugs(data,inits,parameters,model.file="D:/Run/model.txt", n.chains=2,n.iter=5000,n.burnin=1000,n.thin=1,'DIC=True', bugs.directory="c:/Program Files/WinBUGS14/", worki

Re: [R] Help re. Fitting non-linear dynamic model to time series data

2014-12-22 Thread Bert Gunter
Hey, read and follow the posting guide -- go through a tutorial or two, post some code and data, perhaps. Also check out CRAN's time series task view here: http://cran.r-project.org/web/views/TimeSeries.html. You might also try stats.stackexchange.com , as this seems to have more to do with statis

[R] Help re. Fitting non-linear dynamic model to time series data

2014-12-22 Thread Ciaran Roberts
Hey I'm trying to fit the non-linear dynamical model as shown in the image to some time series data. The idea is also to utilize k-fold cross validation to estimate the prediction error. The term Po will be assumed to be constant over a certain timer period and will have to be estimated for eac

Re: [R] number of individuals where X=0 during all periods (longitudinal data)

2014-12-22 Thread William Dunlap
Another approach to to make a table and extract your summaries from the table: > tbl <- with(Test, table(ID, IsZero=X==0)) > tbl IsZero ID FALSE TRUE 1 31 2 02 3 03 > sum(tbl[,"FALSE"] == 0) [1] 2 > sum(tbl[,"FALSE"] == 0 & rowSums(tbl)>=3) [

Re: [R] Automating regression

2014-12-22 Thread Bert Gunter
.. that should have been either myProc <- function(FUN, ...) do.call(FUN,list(...)) or myProc <- function(FUN, ...) FUN(...) My other comments still apply. Bert Gunter Genentech Nonclinical Biostatistics (650) 467-7374 "Data is not information. Information is not knowledge. And knowledge is

Re: [R] Automating regression

2014-12-22 Thread Bert Gunter
"Automate" is vague and ill-defined. But perhaps ?do.call is what you're looking for; e.g. myProc <- function(FUN, ...) do.call(FUN,...) This is one of the cool things about functional type programming -- you can pass functions as arguments. If this is not it, maybe someone else will groc what y

[R] Automating regression

2014-12-22 Thread Steven Yen
How do I specify the type of regression in calling a procedure/ In the following I call the procedure to do a probit regression. Of course, I can change "probit" into "lm" in procedure "myreg" to do a linear regression. My question is, how do I automate this (choice of lm or probit) in callin

Re: [R] VaR and ES through MonteCarlo method

2014-12-22 Thread Jeff Newmiller
Unfortunately for you, there is a no-homework policy on this list. Please read the Posting Guide. --- Jeff NewmillerThe . . Go Live... DCN:Basics: ##.#. ##.#. Live Go..

[R] R: VaR and ES in R

2014-12-22 Thread podaesmeralda
From my Android phone on T-Mobile. The first nationwide 4G network. Messaggio originale Da: ESMERALDA PODA Data:12/22/2014 02:44 PM (GMT+01:00) A: r-help@r-project.org Oggetto: VaR and ES in R Hi everybody, This is the homework I am trying to solve. Ex. Assume that y

[R] Cox model with multiple events - Proportional Hazards Assumption

2014-12-22 Thread Maria Helena Mourino Silva Nunes
Dear all, I'm using the package "survival" for adjusting the Cox model with multiple events (Prentice, Williams and Peterson Model). I have several covariates, some of them are time-dependent. I'm using the function"cox.zph" to check the proportional hazards. Due to the nature of the time-depende

Re: [R] number of individuals where X=0 during all periods (longitudinal data)

2014-12-22 Thread Chel Hee Lee
> tmp <- split(Test, Test$ID) > > # number of subjects with X=0 (all periods) > x <- lapply(tmp, function(x) all(x$X ==0)) > length(x[unlist(x)]) [1] 2 > > # number of subjects with X=0 (at least three weeks) > x <- lapply(tmp, function(x) sum(x$X==0)>=3) > length(x[unlist(x)]) [1] 1 > Is this wh

Re: [R] number of individuals where X=0 during all periods (longitudinal data)

2014-12-22 Thread David L Carlson
Spend a little time with aggregate() ?aggregate - David L Carlson Department of Anthropology Texas A&M University College Station, TX 77840-4352 -Original Message- From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of najuzz Sent: Monday, Dec

[R] number of individuals where X=0 during all periods (longitudinal data)

2014-12-22 Thread najuzz
#Hi guys, #I would like to count the number of individuals that receive X=0 troughout their observational period. #example dataset: ID<-c(1,1,1,1,2,2,3,3,3) X<-c(0,1,2,1,0,0,0,0,0) Time<-c(1,2,3,4,1,2,1,2,3) Test<-data.frame(ID,X,Time) # Individuals 2 and 3 have x=0 during all their periods. Th

[R] VaR and ES through MonteCarlo method

2014-12-22 Thread ESMERALDA PODA
Hi everybody, This is the homework I am trying to solve. Ex. Assume that you have a position of 144530 shares of Bill inc.. The object Y2 contains an iid sample of the returns for these shares. Assume that data follow a Student distribution. 1. Compute the maximum likelihood estimate for

Re: [R] Make 2nd col of 2-col df into header row of same df then adjust col1 data display

2014-12-22 Thread bcrombie
Here's the answer to my question that I came up with after working with all of your suggestions. It's not elegant by any means but gets the job done: MERGE_PViol.Detail.Per.Case <- read.csv("~/FOIA_FLSA/MERGE_PViol.Detail.Per.Case_for_rtf10.csv", stringsAsFactors=TRUE) # select only certain colum