New answers tagged

0

Your question isn't very clear about what exactly you wanted to do. That said, f_classif does ANOVA for feature selection for you instead of chi-squared. R package FSelector provides chi squared feature selection with function chi.squared. Here is the example from the document: https://rdrr.io/cran/FSelector/man/chi.squared.html


2

a) These tests test essentially different things, so you shouldn't be surprised that they give different results. If you look at the data, defect B has a particular pattern, namely a minimum in shift 3 where the others have their maximum (by some distance). This may be the main source for the significant results in the first two tests. In the third test B is ...


0

Consider $Y_i \sim N(\mu_i, \sigma^2)$ (independently) as a random vector with a multivariate normal distribution, $\vec Y \sim N(\vec\mu, \sigma^2 I)$. The main idea is to consider this distribution with reference to a new coordinate system. We choose the first axis to be along $\vec 1 := (1, ..., 1)$. The projection of any vector $\vec y$ onto this axis ...


0

In the formula of chi-square, for each observed frequency you: -- 1) take the difference between the observed frequency and its expected one; -- 2) square the above difference; -- 3) divide the above squared difference by the expected frequency of point 1; -- 4) sum all the results (of points 1-3 applied to every cell in your contingency table) to obtain ...


3

Consider the non-linear regression model $$y_i = \beta^0_1 s(x_i,\lambda^0) + \beta_2^0 f(x_i,\beta^0_3) + \epsilon_i$$ where it is assumed that $s(x,\lambda)$ and $f(x,\beta_3)$ are known functions and the superscript on parameters indicates true values for the parameters. Standard identifying assumption is that $$\mathbb E[y_i\lvert x_i] = \beta^0_1 s(...


1

Forget about it, checking the scipy code I realized that the formula in my textbook is just false. Correct formula starts with $\frac{12}{N(N+1)}$ not with $\frac{12}{N(N-1)}$


1

I have altered the code some to make it clear that you are creating your expected values from the row totals times the column totals, divided by the overall count. Good luck. def pValues(gens,phens): observed=[0.,0.,0.,0.,0.,0.]​ n=len(gens) phen0=0​ phen1=0​ gen0=0​ gen1=0​ gen2=0​ for i in ...


3

You don't need to have balanced frequencies in a chi-squared contingency table, you only need to make sure the counts in any one table cell are not low (i.e., <5). (e.g., Yates continuity correction). The chi-squared test is comparing row and column proportions of counts, and not absolute numbers of frequencies. This is because the expected number of ...


0

You can use the Mann-Whitney U test to compare the mean rank of female answers with the mean rank of males answers.


-1

Your counts per cell are too low. The general rule of thumb is, if the count is bellow 5, use fisher.test. > fisher.test(a) The Fisher exact test extends well to small and large counts, while the chisq.test is generally used for larger counts. You have several values that are 0 and all are below 5, so the Fisher test is what you need!


1

Using R I obtain Call: lm(formula = y ~ x, data = df) Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 138.02137 7.32173 18.85 <2e-16 *** x 1.08185 0.07096 15.25 <2e-16 *** --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 Residual standard error: 10.15 on 34 degrees of ...


2

$H_0$: Amount of missed shot is geometrically distributed with $p = 0.7$ $H_1$: Amount of missed shot is not geometrically distributed with $p = 0.7$ \begin{array} {|r|r|}\hline \text{amount of missed shots} & 0 & 1 & 2 & >2 \\ \hline \text{empirical frequency} & 72 & 18 & 8 & 2 \\ \hline \text{expected frequency} &...


3

Note that it is very common to have a non-significant Chi-squared fit statistic in CFA testing, as it is heavily sensitive to large sample sizes and higher model complexity (i.e. a number of indicators in your model). In your case, it is very unsurprising that the Chi-squared in non-significant, but both CFI and TLI are large. I will gently echo @JeremyMiles ...


4

Clearly it's possible, because it happened. Typically when you have very low chi-squares, you sometimes have very lower CFI/TLI - that was the first think I looked at, because they indicate lower power. You don't have low power, you just have a well fitting model. This is not a problem.


1

Rather than expressing this in terms of the proportions, it is better to deal directly with the underlying count data. You essentially have a $2 \times 2 \times 2$ contingency table of count values, so you should be looking at tests of partial independence for that kind of data. Since you have small count values, it is probably feasible to use a Fisher ...


1

Yes, you could report it that way. The probability of the outcome when eat_hotdog17=0 is $$ p = \dfrac{1}{1+\exp(-0.814)} \approx 30\% $$ When eat_hotdog=1 $$ p = \dfrac{1}{1+\exp(-0.814 - 0.464)} \approx 21\% $$


0

@EdM. So, you're basically saying I should create a table with 100 rows and 3 columns corresponding to outcome, treatment A and treatment B and then do the logistic regression on that? Something like this?


3

Note: $k=N$ throughout the answer. It is well-known that the standard chi-squared distribution with $k$ degrees of freedom has probability density function $$ f_{\sum_{i=1}^{N}Z_i^2}(z)= \frac{z^{\frac{k}{2}-1} e^{-\frac{z}{2}}}{ 2^{\frac{k}{2}}\Gamma(\frac{k}{2})} \mathbb{I}_{z>0}.$$ We may write $Y=\sum_{i=1}^{N}(\sigma Z_i)^2=\sigma^2 \sum_{i=1}^{N}...


1

In this case, Pearson's chi-square test is: A test of independence assess[ing] whether observations consisting of measures on two variables, expressed in a contingency table, are independent of each other. If this table showed independence, then for "when you eat hotdog" there would be 90.5% of individuals claiming "no relationship" and 9.5% claiming ...


Top 50 recent answers are included