Questions tagged [goodness-of-fit]

Goodness of fit tests indicate whether or not it is reasonable to assume that a random sample comes from a specific distribution.

"They are a form of hypothesis testing where the null and alternative hypotheses are:

H0: Sample data come from the stated distribution
HA: Sample data do not come from the stated distribution

These tests are sometimes called *omnibus tests."

Reference:

Ricci, V. (2005). Fitting distributions with R. page 16.


Tag Usage

Questions on should be about implementation and programming problems, not about the statistical or theoretical properties of the technique.
Consider whether your question might be better suited to Cross Validated, the StackExchange site for statistics, machine learning and data analysis.

123 questions
0
votes
0 answers

How can I find the cause of an error in R2ucare package functions? Example data input works fine but new data does not

I'm trying to do a goodness-of-fit test for a Jolly-Move Model (multi-state) in R2ucare. This is done with the function R2ucare::overall_JMV(), which uses other package functions, including R2ucare::test3Gsm() in its source code. The example in…
Roasty247
  • 679
  • 5
  • 20
0
votes
0 answers

For Kolmogorov - Smirnov two sample test on very large data is there a way to split the data into multiple sample and do the computation per sample?

Suppose I have two very large lists with many millions of values. Is there any way to do computation on smaller samples individually and then combine the results from different sample.
0
votes
1 answer

SCIPY Kolmogorov Smirnov test yielding small p-values even with random data generated from given distribution

data = np.random.multivariate_normal(mean=[0, 0], cov=[[1, 0], [0, 1]], size=1000) cdfx = multivariate_normal(mean=[0, 0], cov=[[1, 0], [0, 1]]).cdf ks_1samp(x=data, cdf=cdfx) KstestResult(statistic=0.9930935227267083, pvalue=0.0) Shouldn't…
Imp
  • 11
  • 1
0
votes
0 answers

How to define goodness of fit in curve_fit()?

Hello guys I have used "curve_fit()" to fit my data to voigt function in the following way: def voigt(x,a,m,s,g): z = (x-m+complex(0,g))/(s*math.sqrt(2)) d = wofz(z) return (a*d.real)/(s*math.sqrt(2*pi)) popt, pcov = curve_fit(voigt,…
0
votes
1 answer

goodness of fit of umap

I'm given a 20122-dim matrix, each column is a 20-element vector. Now I apply umap to the matrix and get a 2122 matrix and a umap plot. How to measure the goodness of fit of this umap model? Is there any standard way to do that?
Josie G
  • 145
  • 5
0
votes
1 answer

How to calculate the Power Function of the Chi Square Goodness of Fit Test through Monte Carlo simulations using R?

I need tips of how to calculate the power function of the Chi Square Goodness of Fit test using Monte Carlo Simulations in R. I am familiar with the pwr.chisq function but i need a way to use R to write the code for the Monte Carlo simulation. I can…
0
votes
1 answer

lapply a function to a data frame list and then cbind to corresponding data frame

Problem: Two data frames each containing three columns but different number of rows >view(archae_pro) motif obs pred AAB 1189 760.1757 CDD 1058 249.7147 DDE 771 415.1314 FBB 544 226.3529 >view(archae_end) motif obs pred ABG 1044 749.4967 GBC 634…
Jalan
  • 69
  • 8
0
votes
1 answer

How to adjust degree of freedom in Chi-Square Goodness-of-Fit Test in SAS?

I want to check p-value in chi-Square test, and this is my code in SAS. data dataA; input Ball $ observed; datalines; A 1 B 0 C 0 D 0 E 9 ; run; proc freq data=dataA; tables Ball / chisq; weight observed; run; Here is a problem. This…
Jin.w.Kim
  • 599
  • 1
  • 4
  • 15
0
votes
0 answers

weighted kolmogorov-smirnov-test for single variable

Kolmogorov–Smirnov test KS can be done for the single variable as x <- rnorm(50) ks.test(x, "pnorm", mean=mean(x), sd=sd(x)) Results: One-sample Kolmogorov-Smirnov test data: x D = 0.057841, p-value = 0.9927 alternative hypothesis: two-sided How…
0
votes
1 answer

Why can I not do more than nsim=99 when doing a parametric bootstrap goodness of fit test?

This is my goodness of fit test: (fm <- distsamp(~1 ~ndvi_avg, keyfun="hazard", umf)) # Function returning three fit-statistics. fitstats <- function(fm) { observed <- getY(fm@data) expected <- fitted(fm) resids <- residuals(fm) …
Emily
  • 3
  • 2
0
votes
1 answer

Matlab - Try various start points for gaussian fit, choose the one with highest rsquare and then plot

I am batch processing 1000s of data. Sometime the peak positions and magnitudes change drastically, and the program struggles to find these peaks with a single start point value. I have to divide my data into smaller batches to change the start…
Mosawi
  • 197
  • 2
  • 16
0
votes
0 answers

How to test goodness of fit for Cox model

I have created the following model: data("nwtco") subcoh <- nwtco$in.subcohort selccoh <- with(nwtco, rel==1|subcoh==1) ccoh.data <- nwtco[selccoh,] ccoh.data$subcohort <- subcoh[selccoh] ccoh.data$age <- ccoh.data$age/12 # Age in years fit.ccSP…
0
votes
1 answer

Goodness of Fit statistic Tobit model

I have estimated a Tobit model using the censReg package, along with the censReg function. Alternatively, the same Tobit model is estimated using the tobit function in the AER package. Now, I really like to have some goodness of fit statistic, such…
Daan
  • 43
  • 4
0
votes
0 answers

chi-square results not equal if expected proportions used instead of counts in R

testing goodness of fit between two samples from the same fact in different months. I want to know if results in 4 categories from September are similar/different from October. The issue is my test is giving me different conclusions when using…
Forge
  • 1,587
  • 1
  • 15
  • 36
0
votes
0 answers

How to use stata svy etregress postestimation assumption check

When using survey data and etregress with an endogenous treatment effect in Stata number of diagnostics and post estimate parts stop being available for the use. svy: etregress logwage i.race gender, treat(training = i.education gender)…
iPlexpen
  • 409
  • 1
  • 4
  • 13
1 2 3
8 9