I have been trying to calculate the association in R between two categorical variables—level of education and political party voted. I have 8 choices for education and 8 choices for political parties. How can I determine if there is an association between these two variables and the choices within them? I have been recommended to use Cramer's V, Lambda, and Uncertainty measures. Which method would be appropriate for my question?
24294
I've already read all the pages in this site trying to find the answer to my problem but no one seems to be the right one form me...  First I explain you the kind of data I'm working with...  Let's say that I have an array vector with several names of city, one for each of 300 users. I also have another array vector with scores response to a survey of each user or a continuous value for each user.  I would like to know if exist a correlation coefficient that compute the correlation between these two variables so, between a nominal and a numeric/continuous or ordinal variables.  I've searched on the Internet and in some pages they suggest to use the contingency coefficient or Cramer's V or Lambda coefficient or Eta . For each of this measure the just say that they could be applied for such data in which we have a nominal variable and interval or numerical variable. The thing is that searching and searching, trying to understand every one of them, sometime is written or watching the examples that they are reasonable to use them if you have dichotomous nominal variable, except for Cramer's V, other time is not written any requirement for the type of data. A lot of other pages say that is right to apply regression instead, that is right, but I would just simply like to know if there is a coefficient like pearson/spearman for this kind of data.  I also think that is no so properly to use Spearman Correlation coeff since the cities are not sortable.  I have also built the function of Cramer'sV and Eta by myself (I'm working with Matlab) but for Eta they don't talk about any p-value to see if the coefficient is statistically significant...  In the matlabWorks site there is also a nice toolbox that says to compute eta^2 but the kind of input it needs is not understandable.  Is here someone that have done a test like mine? If you need more detail to understand the kind of data I'm using just ask me and I'll try to explain you better.
92534
I wonder if there is any statistical test to "test" the significance of a bimodal distribution. I mean, How much my data meets the bimodal distribution or not? If so, is there any test in the R program?
96431
What cluster method would be appropriate for a study with 16 variables both categorial and quantitative? It is a repeated measures observational study. I read in a text that k-means would be best if the data was mostly quantitative although I may have interpreted that wrong.  Also, what methods are best for throwing out certain variables prior to performing cluster analysis. I read similar articles to the study I am analyzing, and some opted to do a PCA first, or a discriminant function analysis afterwards to confirm the number of chosen clusters.  Thoughts and comments?
118642
I'm looking to generate a set of 5 random variables and enforce a dependence structure between them and onto a dependent variable $Y$.  I understand how to generate correlated random variables for multivariate normal, but not when mixing different types.  Below is a little more than I need, but I'm hoping someone can give me a general way of solving this problem...   $X_1$ and $X_2$ need to be highly correlated Bernoulli variables.  $X_3$ needs to take one of 5 categorical values, call them "A"..."E".  $X_4$ needs to be normal, and negatively correlated with $X_1$, $X_2$.  $X_5$ needs to approximate test scores from $0$ to $100$ with a high skew, so gamma probably.  $X_5$ needs to be positively correlated with $X_1$, $X_2$, $X_4$.   Each of these variables must impact a "success/occurrence" Bernoulli distributed variable $Y$.  How would I begin?  I would like to enforce correlation both between the values of $X$, and also between each $X$ and $Y$.  (The categorical correlations seem particularly confusing to me.)
1109
I have a data having 2 continuous and 4 categorical variables. Each categorical variable has 3 levels. I want to know how to include the variables  in the model. I am using SPSS  Variables:   Sales - Dependent Variable Retail Price Location : TX, CA, PY Display Location in Store : DL1, DL2, DL3 Price Point : 2.5, 4.5, 1.0   I have created 9 dummy variables. 3 for Location, 3 for Display Location in Store and 3 for Price Point.  I am confused on how to use these independent variables. How to add the independent variables into the models. Should I add all the nine dummy variables or two dummy variables of each categorical variables along with Retail Price.  I searched on net but , did not get any solution. I would appreciate any kind of help.  Thanks in advance.
79580
I am performing simple (first-order terms) linear regression on data having several categorical variables (i.e. factors), and it is often desired that for each factor, one of the levels should add nothing to the regressand, and the other levels should add positive values to the regressand.  When I perform a regression analyses, however, I often get a lot of negative coefficients.  Is there a non-manual way of choosing which levels of a factor should be used as regressor variables in order to maximize the number of positive coefficients in the equation?  In other words, how can I get R to do this (somewhat tedious) task for me?
111728
I have six dependent variables (count data) and several independent variables, I see that in a MMR the script goes like this:  my.model &lt;- lm(cbind(DV1,DV2,DV3,DV4,DV5,DV6) ~ IV1 + IV2 + ... + IVn)   But, since my data are counts, I want to use a generalized linear model and I tried this:  my.model &lt;- glm(cbind(DV1,DV2,DV3,DV4,DV5,DV6) ~ IV1 + IV2 + ... + IVn, family="poisson")   And appears this error message:  Error in glm.fit(x = c(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,  :    (subscript) logical subscript too long`   Can anyone explain me this error message or a way to solve my problem?
9017
I'm struggling with the interpretation of a regression model where a categorial variable (5 levels) is dummy coded. Here is the result of my calculation in R:  Call: lm(formula = DV ~ Age + Gender + factor(Categorial) +  Continuous 1 + Continuous 2 + Continuous 3,  data = dat)  Residuals:  Min       1Q   Median       3Q      Max  -1.30058 -0.25326  0.00349  0.28123  1.49877   Coefficients:                       Estimate Std. Error t value Pr(&gt;|t|)    (Intercept)           -0.42367    0.30694  -1.380  0.16842    Age                   -0.05949    0.02026  -2.936  0.00356 ** Gender                -0.01800    0.04828  -0.373  0.70952    factor(Categorial)2   -0.30625    0.12645  -2.422  0.01596 *  factor(Categorial)3   -0.03441    0.07752  -0.444  0.65736    factor(Categorial)4   -0.12603    0.09914  -1.271  0.20453    factor(Categorial)5   -0.08417    0.13269  -0.634  0.52630     Continuous 1           0.12080    0.04346   2.779  0.00575 ** Continuous 2          -0.06592    0.04383  -1.504  0.13354    Continuous 3          -0.06230    0.03475  -1.793  0.07392 .  --- Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1  Residual standard error: 0.4259 on 336 degrees of freedom   (6 observations deleted due to missingness) Multiple R-squared:  0.1315,    Adjusted R-squared:  0.1057  F-statistic: 5.089 on 10 and 336 DF,  p-value: 6.353e-07   Ok. Age, Factor 2 of the categorial variable and the first continuous variable are significant predictors of the dependent variable. so far so good.   What I'm not understanding is:   The reference category of the dummy coded categorial variable is the intercept and the first category of the categorial variable. right? How do I interpret this?  When doing an anova with the categorial variable as a independent variable, this factor is a significant predictor. With the results of the linear model, one could conclude that this is only due to category 2, right? Can I test contrasts with this linear regression model (e.g. Category1 vs. Category2)? Should I include interactions?   I'd be glad for any help :-)
6777
I've read that it's bad to do this, but am looking for details as to why.  Suppose we're trying to fit the linear model $Y_i = \beta_0 + \beta_1 X_{1i} + \beta_2 X_{2i} + \epsilon_i$ where $Y$ is continuous and $X$s are categorical with many levels. We don't have any opinion on how the levels should be grouped. We then calculate the average response for each level of the predictors, then collapse levels with similar averages.  How badly does this screw up parameter estimates and inferences on them, and why?
26576
I am running a logit regression on a dataset with only 2 independent categorical variables, country and device type. Both of these variables can take several values. The dependant variable is binary. The event occurs approximately 0.2% of the time.  For certain countries, the coefficients are significant, but I do not have any positive event for this country. How can this happen ?  I am using the glm procedure in R.  Thank you,
103313
Is there any adjustment required when computing the correlation coefficient between:   continuous and discrete variable  two discrete variables ?    Thanks !
36517
I am using FactoMineR to reduce my data set of measurements to the latent variables.     The variable map above is clear for me to interpret, but I am confused when it comes to the associations between the variables and component 1. Looking at the variable map, ddp and covis very close to the component in the map, and ddpAbs is a bit further away. But, this is not what the correlations show:  $Dim.1 $Dim.1$quanti         correlation      p.value jittAbs   0.9388158 1.166116e-11 rpvi      0.9388158 1.166116e-11 sd        0.9359214 1.912641e-11 ddpAbs    0.9327135 3.224252e-11 rapAbs    0.9327135 3.224252e-11 ppq5      0.9319101 3.660014e-11 ppq5Abs   0.9247266 1.066303e-10 cov       0.9150209 3.865897e-10 npvi      0.8853941 9.005243e-09 ddp       0.8554260 1.002460e-07 rap       0.8554260 1.002460e-07 jitt      0.8181207 1.042053e-06 cov5_x    0.6596751 4.533596e-04 ps13_20  -0.4593369 2.394361e-02 ps5_12   -0.5237125 8.625918e-03   Then there is the sin2 quantity, which is height for  rpvi (for instance), but that measure is not the variable that is closest to the first component at all.   Variables            Dim.1    ctr   cos2    Dim.2    ctr   cos2   rpvi    |  0.939  8.126  0.881 |  0.147  1.020  0.022 | npvi    |  0.885  7.227  0.784 |  0.075  0.267  0.006 | cov     |  0.915  7.719  0.837 | -0.006  0.001  0.000 | jittAbs |  0.939  8.126  0.881 |  0.147  1.020  0.022 | jitt    |  0.818  6.171  0.669 |  0.090  0.380  0.008 | rapAbs  |  0.933  8.020  0.870 |  0.126  0.746  0.016 | rap     |  0.855  6.746  0.732 |  0.040  0.076  0.002 | ppq5Abs |  0.925  7.884  0.855 |  0.091  0.392  0.008 | ppq5    |  0.932  8.007  0.868 | -0.035  0.057  0.001 | ddpAbs  |  0.933  8.020  0.870 |  0.126  0.746  0.016 | ddp     |  0.855  6.746  0.732 |  0.040  0.076  0.002 | pa      |  0.265  0.646  0.070 | -0.857 34.614  0.735 | ps5_12  | -0.524  2.529  0.274 |  0.664 20.759  0.441 | ps13_20 | -0.459  1.945  0.211 |  0.885 36.867  0.783 | cov5_x  |  0.660  4.012  0.435 |  0.245  2.831  0.060 | sd      |  0.936  8.076  0.876 |  0.056  0.150  0.003 |   So, what should I look at when it comes the association between a variable and the first component?
100706
I have four random variables, A, B, C, D, with known mean and variance. As well:   Cov(A,B) is known and non-zero  Cov(C,D) is known and non-zero  A and C are independent   A and D are independent  B and C are independent   B and D are independent   I then create two new random variables:   X = A*C Y = B*D   Is there any way to determine Cov(X,Y) or Var(X+Y)?   If not exactly, is there any way to estimate it? What if I could determine the distributions of A and B and C and D?
20290
I am running a logistic regression, where the dependent variable is marital status. And I assume that educated women are different from women with e.g. high school degree and are less likely to marry. Does it make sense to interact 2 binary variables? I remember that we usually interacted a continuous and a binary variable, that is why I am hesitating to include this interaction and how to interpret it. Please help.
108619
It looks like you can use coding for one categorical variable, but I have two categorical and one continuous predictor variable. Can i use multiple regression for this in SPSS and if so how? thanks!
97343
What is the best statistical test for investigating if there is any correlation between 2 categorical variables? Both are satisfaction scores: 1st variable is:  Overall satisfaction with the service. 1: Not at all satisfied; 10: Completely satisfied  2nd variable is:  Satisfaction with the availability of information for the service&quot; 1: Not at all satisfied; 10: Completely satisfied.
3006
Suppose we have $n$ covariates $x_1, \dots, x_n$ and a binary outcome variable $y$. Some of these covariates are categorical with multiple levels. Others are continuous. How would you choose the "best" model? In other words, how do you choose which covariates to include in the model?  Would you model $y$ with each of the covariates individually using simple logistic regression and choose the ones with a significant association?