statistical-test

Export coxph summary from R to csv

爱⌒轻易说出口 提交于 2021-02-11 06:11:47
问题 How to export summary of cox_proportional hazard model from R to csv. I ran a test by function coxph. by survival package Now i want to export its summary to csv, how to do that. c <- coxph(Surv(x~y)) summary(c) 回答1: From the ?coxph examples, I'll use: library(survival) test1 <- list(time=c(4,3,1,1,2,2,3), status=c(1,1,1,0,1,1,0), x=c(0,2,1,1,1,0,0), sex=c(0,0,0,0,1,1,1)) mdl <- coxph(Surv(time, status) ~ x + strata(sex), test1) mdl_summ <- summary(mdl) mdl_summ # Call: # coxph(formula = Surv

Export coxph summary from R to csv

倾然丶 夕夏残阳落幕 提交于 2021-02-11 06:09:46
问题 How to export summary of cox_proportional hazard model from R to csv. I ran a test by function coxph. by survival package Now i want to export its summary to csv, how to do that. c <- coxph(Surv(x~y)) summary(c) 回答1: From the ?coxph examples, I'll use: library(survival) test1 <- list(time=c(4,3,1,1,2,2,3), status=c(1,1,1,0,1,1,0), x=c(0,2,1,1,1,0,0), sex=c(0,0,0,0,1,1,1)) mdl <- coxph(Surv(time, status) ~ x + strata(sex), test1) mdl_summ <- summary(mdl) mdl_summ # Call: # coxph(formula = Surv

Export coxph summary from R to csv

三世轮回 提交于 2021-02-11 06:08:47
问题 How to export summary of cox_proportional hazard model from R to csv. I ran a test by function coxph. by survival package Now i want to export its summary to csv, how to do that. c <- coxph(Surv(x~y)) summary(c) 回答1: From the ?coxph examples, I'll use: library(survival) test1 <- list(time=c(4,3,1,1,2,2,3), status=c(1,1,1,0,1,1,0), x=c(0,2,1,1,1,0,0), sex=c(0,0,0,0,1,1,1)) mdl <- coxph(Surv(time, status) ~ x + strata(sex), test1) mdl_summ <- summary(mdl) mdl_summ # Call: # coxph(formula = Surv

How to create a search for common fit distribution of two Goodness-to-fit tests list?

别等时光非礼了梦想. 提交于 2020-05-17 05:54:13
问题 I looked into the question Best fit Distribution plots and found out that answers used the Kolmogorov-Smirnov Test to find the best fit distribution. I also found out that there is an Anderson-Darling test that is also used to get the best fit distribution based on given data. So, I have a few questions: Question 1: If I want to combine both tests, how can I do that where it searches for the maximum p-value of both tests(find the highest p-value and is common in both tests then I extract the

Suppress output of stationarity test that is printed to screen

橙三吉。 提交于 2020-01-13 09:59:06
问题 How do I get the stationarity test from the fractal package in R to not print any output to the screen. For example, with the shapiro.wilk test when setting the result as a variable it does not give any output as follows lg.day.ret.vec <- rnorm(100, mean = 5, sd = 3) shap.p <- shapiro.test(lg.day.ret.vec)$p.value This is the case for most tests but when I do it for the stationarity test I get some output in the r console. library(fractal) stat.p <- attr(stationarity(lg.day.ret.vec),"pvals")[1

Error in predicting test data when apply prediction fda.model (flexible discriminant analysis)

杀马特。学长 韩版系。学妹 提交于 2019-12-25 16:38:22
问题 library(mda) I'm using: pred.test <- predict(model.fda, test.data) after model.fda <- fda(Y~., train.data) but obtained the following message: Error in mindist[l] <- ndist[l] : NAs are not allowed in subscripted assignments. Thank you very much for the hint! 回答1: I've solved this issue after normalizing the data (It was binary values only and maybe too sparse in my case). 来源: https://stackoverflow.com/questions/30172523/error-in-predicting-test-data-when-apply-prediction-fda-model-flexible

Suppress output of stationarity test that is printed to screen

守給你的承諾、 提交于 2019-12-05 09:32:43
How do I get the stationarity test from the fractal package in R to not print any output to the screen. For example, with the shapiro.wilk test when setting the result as a variable it does not give any output as follows lg.day.ret.vec <- rnorm(100, mean = 5, sd = 3) shap.p <- shapiro.test(lg.day.ret.vec)$p.value This is the case for most tests but when I do it for the stationarity test I get some output in the r console. library(fractal) stat.p <- attr(stationarity(lg.day.ret.vec),"pvals")[1] 1 2 3 4 5 6 N = 2609, nblock = 11, n_block_max = 238, dt = 1.0000 7 8 9 10 11 12 13 14 15 16 17 18 In