1
vote
2answers
41 views

Understanding dummy (manual or automated) variable creation in GLM

If a factor variable (e.g. gender with levels M and F) is used in the glm formula, dummy variable(s) are created, and can be found in the glm model summary along with their associated coefficients ...
0
votes
0answers
30 views

Splitting factors in R [migrated]

I have a factor with values of the form Single (w/children), Married (no children), ...
0
votes
0answers
38 views

Converting factors to numeric values in R [migrated]

I have factors in R that are salary ranges of the form $100,001 - $150,000, over $150,000, ...
1
vote
0answers
18 views

Finding multivariate clusters with survey data (in R)

I'd like to conduct a multivariate cluster analysis on data from the American Community Survey's PUMS microsample (individual level records). I've only performed cluster analysis before when there are ...
-1
votes
0answers
32 views

Weighted effects coding in R

Background: I have effect sizes for 6 different anxiety disorders. I want to see if any of those effect sizes are significantly different from the grand mean of effect sizes. A simple effects coding ...
0
votes
0answers
12 views

Detecting poaching by age class proportion - suggested test for detecting decrease in given age class?

My dataset consists of observations of individuals, recording the date and the individual's age class. Age classes vary in bin size: 0-4 5-9 10-19 20-40 Example ...
1
vote
0answers
35 views

Interpretation of p-values & reduction of model deviance for factors in anova() vs summary()

My data has 3 major inputs: BLDDAY (a factor), BLDMNT (a factor), and D_BLD_SER (days as an ...
2
votes
1answer
151 views

Categorize continuous data effectively (taking into account a response variable)

I wonder what are the better approaches to categorize continuous data (e.g. age) than dividing them with the use of quantiles and cut function (in ...
0
votes
0answers
47 views

Interpreting RandomForest variable importance in case of multiple polytomous dummy variables

I have some trouble interpreting R's RandomForest variable importance measures when using multiple polytomous dummy variables. Take the following example: I have paired country data, e.g. ...
0
votes
0answers
19 views

Phylogenetic GLS with categorical response variable

I want to perform phylogenetic comparative analysis on a multilevel (3 level) categorical response variable, preferentially in R. Does anyone know how to do that or if there is a way to do at least? ...
1
vote
1answer
62 views

Strength of association test with binary variables

I have a dataset with different purchases for two different items from the same users. So the users purchased the two items at different points in time. I also have 3 different variables: ...
0
votes
1answer
78 views

R: Missing levels of categorical variable in summary of linear model [duplicate]

In my formula I have several terms with the categorical variable color and color's interaction with other variables. Color can ...
1
vote
1answer
67 views

How to reference R's automatically generated dummy variables in a linear model

R is creating dummy variables for the color variable (color is either white or red) in my linear regression model. For example, color:pH returns the interaction term colorred:pH. Some questions: Why ...
0
votes
0answers
54 views

Correction for non-linear trend seen in residuals plot when predictor is categorical

I'm running a linear regression analysis in R. One variable is a continuous outcome variable (score2) and the other is a categorical variable for treatment group ...
2
votes
3answers
177 views

Naive Bayesian Algorithm in R/SAS for categorical input variables?

Could anyone please let me know how to implement Naive Bayesian Algorithm in R or SAS?I have got a training dataset with all the categorical predictors and target variable(3 levels).I got to build a ...
1
vote
1answer
74 views

How to create predictive model in R when outcome variable has more than 10 classes?

I have a dataset for vehicles and trying to predict what will fail. Here is my data set ...
0
votes
0answers
5 views

how to create predictive model in R when outcome variable has more than 10 classes [duplicate]

I have a dataset for vehicles and trying to predict what will fail. Here is my data set ...
5
votes
4answers
1k views

Warning in R - Chi-squared approximation may be incorrect

I have data showing fire fighter entrance exam results. I am testing the hypothesis that exam results are dependent on ethnicity. To test this, I ran a Pearson chi-square test in R. The results show ...
0
votes
2answers
74 views

Predict binary outcome with R

I posted my original question here, but was told that I should have posted at Cross Validated, below is the link to the original question: ...
1
vote
2answers
94 views

Predict binary outcome with R

I have a table includes the following data: ...
2
votes
1answer
45 views

How to measure association of nominal values for few observations?

I have a sample with 181 observations. I measured two nominal variables for each observation and now want to calculate the association between the two variables. The problem is that one variable has ...
0
votes
0answers
73 views

How to present dummy variables from linear regression in table?

I have carried out this linear regression that includes month coded as a dummy variable: ...
0
votes
1answer
205 views

Interpreting intercepts in mixed effect model with categorical predictors

Trying to fit a linear mixed effects model with 2 categorical predictors (group & worker) where worker is a random effect and group a fixed effect. I'm trying to figure out 1) whether I should ...
1
vote
0answers
30 views

How can I get a “whole treatment effect” for a 3 level categorical variable in a GLMM (glmmPQL in R)

I work with habitat use data (summarized binomial data: visited / did not visit) which I fitted with a mixed model of the binomial family with a random factor accounting for repeated sampling of the ...
0
votes
0answers
36 views

dealing with categorical variables when using softImpute for missing data

I'm trying to impute missing values but I have problem dealing with categorical variables. The command softImpute calculate the missing values but they also turn categorical variables, which is ...
1
vote
1answer
173 views

Handling redundant factor variable levels for linear regressions in R

Say I have two factor variables, X and Y, each with 3 levels. However, X==3 if and only if Y==3, while such a connection doesn't hold for X,Y==1,2. In this case, while X and Y are not redundant, my ...
0
votes
1answer
75 views

Contingency table analysis to rank preferences of birds per feature

I have a dataset that contains observations of objects that female blackbirds carry to their nests. The birds have id tags and the objects are grouped categorically with respect to their ...
0
votes
2answers
114 views

Chi-square using factors with multiple levels in R

I'm not sure if I have the right concept of how to perform the chi-square test. I have a variable called race which is a factor with multiple levels for different ...
0
votes
0answers
46 views

What statistical test would be appropriate to analyse these proportions?

I have this matrix: ...
0
votes
0answers
47 views

glmnet converges extremely slowly for multinomial with mass function concentrated at one point

If I have a response vector that is mostly one class label, convergence of Lasso in glmnet will be extremely slow, for example: ...
1
vote
0answers
38 views

Handling Infrequently Occurring Categorical Variables

I'm dealing with some data where there are some infrequently occuring categorical variables related to a binary prediction target. For example marketing partners... some send 1000s of leads but many ...
0
votes
0answers
49 views

Dependency of a third factor in a correlation between 2 continuous variables?

I'm studying the correlation between 2 continuous variables (A~B), the first is an independent measured variable (A), the second one is a dependent estimated variable (B). I'd like to know i) if the ...
2
votes
1answer
125 views

Puzzling behavior of glmer()

I'd like your opinion on a very strange behavior that I recently encountered running glmer(). The problem is that when I make the dependent variable into a logical vector, glmer behaves weirdly. My ...
2
votes
2answers
162 views

What do p-values for levels of a categorical variable represent in Poisson regression?

I have a Poisson model with varying densities: set.seed(1) df = data.frame(density = 1:5, events = rpois(2000, 1:5)) If I regress on this, I get that the ...
0
votes
0answers
70 views

Multi Factor analysis with FactoMineR

I have a database with different variables, both categorical and numerical. I wanted to analyse these using MultiFactor Analysis with FactoMineR, with the main idea to obtain which of them are the ...
0
votes
0answers
33 views

R: Mediation analysis with outcome as factor

I am not sure how to do a mediation analysis with my outcome as a factor while mediating and causal variables are continuous. I have tried using the "mediation" package in R for this mediation ...
3
votes
2answers
319 views

Qualitative variable coding in regression leads to “singularities”

I have an independent variable called "quality"; this variable has 3 modalities of response (bad quality; medium quality; high quality). I want to introduce this independent variable into my multiple ...
3
votes
1answer
186 views

Negative binomial GLM with 2 factor variables: adding interaction completely changes effect of factor levels

I am emailing for a sanity-check please! I am analysing some marine wildlife monitoring data from an offshore construction site. The response data are counts of animals (corrected for detection ...
1
vote
0answers
49 views

interpreting R lm(..) output when a variable is used as a factor [duplicate]

Below is a print screen of a summary(lm(..)). I called the response variable response explained by a continuous variable X and ...
1
vote
0answers
76 views

Testing independence on multivariate categorical data

Let $S_1$ = $(X_1, Y_1)$ and $S_2$ = $(X_2, Y_2)$ be two samples from two groups. The broad null hypothesis is that they come from the same distribution. Note $X$ is a matrix here with many columns ...
1
vote
1answer
169 views

Correlation or independence on contingency table for large N

I have a dataset with about 35,000 individuals described by around 15 categorical variables. I'm trying to study the independence / correlation between these 15 categorical variables. My first idea ...
1
vote
1answer
81 views

Generate two categorical variables with a certain association?

Say, I wish to simulate two categorical variables who are associated with each other like in the table: ...
1
vote
0answers
272 views

GLM and categorical variable R - remove one category

I am currently running quasipoisson models with a continuous response variable and 13 covariates. I am using glm() and ...
1
vote
1answer
183 views

Likelihood ratio test in R for categorical variables

I am working with behavioral data of male sea lions, with a binomial model to understand the effect of different variables in determining the location where the encounters between males occur (Land ...
2
votes
1answer
215 views

R's coxph won't converge when I include factor (categorical) variables

I have a dataset of 371 observations. When I run coxph with numeric variables it works fine. However, when I try to add factor (categorical) variables it returns ...
1
vote
1answer
147 views

Order of variables in R lm model

Is the order of variables in an R model supposed to be significant? For some reason, the two models below result in different coefficients associated with fm and yr (which are supposed to model fixed ...
2
votes
1answer
334 views

Glmnet and dummy variable trap

When feeding a categorical variable into glmnet do I code n or n-1 dummy variables? For ...
2
votes
2answers
106 views

Can I use multiple groups of dummy variables? How do I interpret results for missing groups?

Say I want to do a logistic regression on whether it snows on a given month of the year and day of the week. I'd have 12 months and 7 days. My understanding is that this would translate into 17 ...
0
votes
0answers
14 views

Reduce Sample Size (Categorise??) [duplicate]

I have been looking for an answer to my question but havn't been able to find any literature documentation or help in regards. I have a large dataset which I need to further analyse. Because of this I ...
4
votes
1answer
243 views

Dummy coding for contrasts: 0,1 vs. 1,-1

I'm seeking your help in understanding the difference between two different contrasts for dichotomous variables. On this page: http://www.psychstat.missouristate.edu/multibook/mlt08.htm under ...