similar to: error message from predict.coxph

Displaying 20 results from an estimated 400 matches similar to: "error message from predict.coxph"

2011 Jul 02
1
Simulating inhomogeneous Poisson process without loop
Dear all I want to simulate a stochastic jump variance process where N is Bernoulli with intensity lambda0 + lambda1*Vt. lambda0 is constant and lambda1 can be interpreted as a regression coefficient on the current variance level Vt. J is a scaling factor How can I rewrite this avoiding the loop structure which is very time-consuming for long simulations? for (i in 1:N){ ... N <- rbinom(n=1,
2013 Jul 01
2
Problem with anova and the new abbreviation restrictions
An unwanted side effect of the new restrictions on abrreviated names. The anova.coxph command, in a slavish copy of anova.lm etc, returns a data frame with column labels of loglik Chisq Df Pr(>|Chi|) If one tries to extract the final column of the table errors result since it is not a standard R variable name. > afit <- anova(lm(conc ~ uptake, CO2)) > afit$P [1]
2013 Sep 10
0
Looping an lapply linear regression function
Hi, Try: dat2<- read.csv("BOlValues.csv",header=TRUE,sep="\t",row.names=1) dim(dat2) #[1] 20 28 indx2<-expand.grid(names(dat2),names(dat2),stringsAsFactors=FALSE) nrow(indx2) #[1] 784 indx2New<- indx2[indx2[,1]!=indx2[,2],] nrow(indx2New) #[1] 756 res2<-sapply(seq_len(nrow(indx2New)),function(i) {x1<- indx2New[i,];
2009 Sep 28
1
help with lda function
I am having a problem understanding the lda package. I have a dataset here: [,1] [,2] [,3] [1,] 2.95 6.63 0 [2,] 2.53 7.79 0 [3,] 3.57 5.65 0 [4,] 3.16 5.47 0 [5,] 2.58 4.46 1 [6,] 2.16 6.22 1 [7,] 3.27 3.52 1 If I do the following; "names(d)<-c("y","x1","x2") d$x1 = d$x1 * 100 d$x2 = d$x2 * 100 g<-lda( y ~ x1 + x2, data=d) v2
2010 Jul 16
1
I need help making a data.fame comprised of selected columns of an original data frame.
I must have missed something simple, but still, i don't know what. I obtained my basic data as follows: x <- sprintf("SELECT m_id,sale_date,YEAR(sale_date) AS sale_year,WEEK(sale_date) AS sale_week,return_type,0.0001 + DATEDIFF(return_date,sale_date) AS elapsed_time FROM `merchants2`.`risk_input` WHERE DATEDIFF(return_date,sale_date) IS NOT NULL") moreinfo <- dbGetQuery(con,
2012 Jun 04
1
simulation of modified bartlett's test
Hi, I run this code to get the power of the test for modified bartlett's test..but I'm not really sure that my coding is right.. #normal distribution unequal variance asim<-5000 pv<-rep(NA,asim) for(i in 1:asim) {print(i) set.seed(i) n1<-20 n2<-20 n3<-20 mu<-0 sd1<-sqrt(25) sd2<-sqrt(50) sd3<-sqrt(100) g1<-rnorm(n1,mu,sd1) g2<-rnorm(n2,mu,sd2)
2017 Oct 12
0
comparing two strings from data
It's generally a very good idea to examine the structure of data after you have read it in. str(data2) would have shown you that read.csv() turned your strings into factors, and that's why the == operator no longer does what you think it does. use ... data_2 <- read.csv("excel_data.csv", stringsAsFactors = FALSE) ... to turn this off. Also, the %in% operator will achieve
2009 Sep 29
1
help with lda function from MASS package
Thanks David, Yes, I am talking about the MASS package.Thank you for pointing out that these scale the same. My question is, how do I get from the V1 data: V1 1 164.4283 2 166.2492 3 170.5232 4 156.5622 5 127.7540 6 136.7704 7 136.3436 to the other set of data: + 1 -2.3769280 + 2 -2.7049437 + 3 -3.4748309 + 4 -0.9599825 + 5 4.2293774 + 6 2.6052193 + 7 2.6820884 On Mon, Sep 28, 2009
2017 Oct 13
1
comparing two strings from data
Combining and completing the advice from Greg and Boris the complete solution is two lines: data_2 <- read.csv("excel_data.csv", stringsAsFactors = FALSE) match_list <- match( data_2$data1, data_2$data2 ) The vector match_list will have the matching position when it exists and NA's otherwise. Its length will be the same as the length of data_2$data1. You should get
2009 May 16
1
maxLik pakage
Hi all; I recently have been used 'maxLik' function for maximizing G2StNV178 function with gradient function gradlik; for receiving this goal, I write the following program; but I have been seen an error  in calling gradient  function; The maxLik function can't enter gradlik function (definition of gradient function); I guess my mistake is in line ******** ,that the vector  ‘h’ is
2008 Sep 11
0
Loop for the convergence of shape parameter
Hello, The likelihood includes two parameters to be estimated: lambda (=beta0+beta1*x) and alpha. The algorithm for the estimation is as following: 1) with alpha=0, estimate lambda (estimate beta0 and beta1 via GLM) 2) with lambda, estimate alpha via ML estimation 3) with updataed alpha, replicate 1) and 2) until alpha is converged to a value I coded 1) and 2) (it works), but faced some
2017 Oct 12
4
comparing two strings from data
Hi, I have two columns that contain numbers along with letters (as shown below) and have different lengths. Each entry in the first column is likely to be found in the second column at most once. For each entry of the first column, if that entry is found in the second column, I would like to get the corresponding index. For instance, if the first entry of the first column is 5th entry in the
2009 Jan 05
1
transform R to C
Dear R users, i would like to transform the following function from R-code to C-code and call it from R in order to speed up the computation because in my other functions this function is called many times. `dgcpois` <- function(z, lambda1, lambda2) { `f1` <- function(alpha, lambda1, lambda2) return(exp(log(lambda1) * (alpha - 1) - lambda2 * lgamma(alpha))) `f2` <-
2009 Nov 05
4
The equivalence of t.test and the hypothesis testing of one way ANOVA
I read somewhere that t.test is equivalent to a hypothesis testing for one way ANOVA. But I'm wondering how they are equivalent. In the following code, the p-value by t.test() is not the same from the value in the last command. Could somebody let me know where I am wrong? > set.seed(0) > N1=10 > N2=10 > x=rnorm(N1) > y=rnorm(N2) > t.test(x,y) Welch Two Sample t-test data:
2010 Jul 16
1
Troubles with DBI's dbWriteTable in RMySQL
I am feeling rather dumb right now. I created what I thought was a data.frame as follows: aaa <- lapply(split(moreinfo,list(moreinfo$m_id),drop = TRUE), fun_m_id) m_id_default_res <- do.call(rbind, aaa) print("==========================================") m_id_default_res print("==========================================") ndf <- m_id_default_res[, c('mid',
2006 Jul 20
1
Loss of numerical precision from conversion to list ?
I?m working on an R-implementation of the simulation-based finite-sample null-distribution of (R)LR-Test in Mixed Models (i.e. testing for Var(RandomEffect)=0) derived by C. M. Crainiceanu and D. Ruppert. I'm in the beginning stages of this project and while comparing quick and dirty grid-search-methods and more exact optim()/optimize()-based methods to find the maximum of a part of the
2010 Feb 09
1
"1 observation deleted due to missingness" from summary() on the result of aov()
I have the R code at the end. The last command gives me "1 observation deleted due to missingness". I don't understand what this error message. Could somebody help me understand it and how to fix the problem? > summary(afit) Df Sum Sq Mean Sq F value Pr(>F) A 2 0.328 0.16382 0.1899 0.82727 B 3 2.882 0.96057 1.1136 0.34644 C
2013 Sep 27
0
Best and Worst values
Ira, obj_name<- load("arun.RData") Pred1<- get(obj_name[1]) Actual1<- get(obj_name[2]) dat2<- data.frame(S1=rep(Pred1[,1],ncol(Pred1)-1),variable=rep(colnames(Pred1)[-1],each=nrow(Pred1)),Predict=unlist(Pred1[,-1],use.names=FALSE),Actual=unlist(Actual1[,-1],use.names=FALSE),stringsAsFactors=FALSE) dat2New<- dat2[!(is.na(dat2$Predict)|is.na(dat2$Actual)),] ?dat3<-
2013 Jun 18
1
install a package made using bioconductor package pdInfoBuilder
Dear maintainer, I used bioconductor package, pdInfoBuilder, to make a microarray platform annotation package. I named this package, pd.pdinfo.gpl11164.ndf.txt. This "self-made package" is to be used with oligo package. Prior to using oligo package, I need to install the annotation package, pd.pdinfo.gpl11164.ndf.txt, and cannot just copy it to the library tree. I tried using the
2008 Sep 12
1
Error in "[<-"(`*tmp*`, i, value = numeric(0)) :
I use "while" loop but it produces an errro. I have no idea about this. Error in "[<-"(`*tmp*`, i, value = numeric(0)) : nothing to replace with The problem description is The likelihood includes two parameters to be estimated: lambda (=beta0+beta1*x) and alpha. The algorithm for the estimation is as following: 1) with alpha=0, estimate lambda (estimate beta0