# Tagged Questions

17 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 ...
42 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 ...
32 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 ...
53 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 ...
39 views

### What statistical test would be appropriate to analyse these proportions?

I have this matrix: ...
24 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: ...
33 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 ...
39 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 ...
78 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 ...
99 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 ...
48 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 ...
25 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 ...
126 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 ...
87 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 ...
127 views

### Optimizing Internet Article Posting Schedule

I've plotted posting time by visits for the different categories of posts (lists, photos, story)on 3 different time series graphs (there's some auto-correlation for the first few days of every post). ...
47 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 ...
50 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 ...
95 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 ...
59 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: ...
120 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 ...
107 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 ...
122 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 ...
109 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 ...
215 views

### Glmnet and dummy variable trap

When feeding a categorical variable into glmnet do I code n or n-1 dummy variables? For ...
84 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 ...
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 ...
176 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 ...
153 views

### ARIMA forecasting with external regressors

I am trying to build ARMAX models using auto.arima. I have a time series to forecast (weekly and monthly seasonality, I've put the ts() frequency=7), another two time series as external regressors, ...
255 views

### Select best set of binary variables for clustering known sample labels

I have a set of samples, for which I know the "true groups". For this samples I have about 200 binary variables, I would like to know a method to select the subset of variables, that gives me a ...
187 views

### Variable selection / Dataset reduction for large datasets (in R)

I'm working on a behavoural scorecard modelling exercise, and many of the decisions taken to date have been based on the experience of a consulting credit analyst (whose experience software-wise is ...
314 views

### ARIMA and external regressors in SAS and R

So I remember reading somewhere that when we have external regressors, auto.arima cannot make correct predictions for the order of difference for either ...
104 views

### Dummy variables for time series

I'm a new user on R. I'm stuck on my times series research currently with the some questions. Not sure anyone can help me. Dummy variable. I wanted to add more than 1 dummy variable in the model. ...
165 views

### Plot normal probability for effect estimates in factorial design in R

I have 2 level Design (DOE) with 4 factors (A,B,C,D). I've already calculated the estimates for each main effect and all the interaction effects. How can I construct the normal probability plot to ...
45 views

### Dealing with Dates of Birth in Predictor

I have a predictor variable of type factor which contains the date of birth. From your experience (when dealing with logistic regression), what is the best way of treating date of birth (or similar ...
83 views

### What factor (trials or blocks) to use in a repeated measures ANOVA

I am conducting a psycholinguistic experiment. Each trial consists of the subject responding to a word by pressing a button.The design of my experiment is as follows: 5 blocks of a 100 trials each ...
55 views

### Log-linear analysis vs Breslow-day test

I would like to test independence of several categorical variables for a few datasets. I believe Breslow-day is possible for some of the analyses I want to do, and log-linear may be possible for all, ...
43 views

### Preparation of categorical data for hierarchical clustering

I would like to use R to perform a hierarchical clustering of data that looks like this: L1 L2 L3 F1 p pr r F2 p NA r which is supposed to ...
100 views

### When is it valid to include interaction terms in a regression model? [duplicate]

I am using logistic regression to analyze some categorical data (binary response variable and categorical -- mostly binary -- predictor variables). For my model, I have something like ...
969 views

### Interpreting interaction terms in logit regression with categorical variables

I have data from a survey experiment in which respondents were randomly assigned to one of four groups: ...
221 views

### Getting rid of a huge categorical factor in multiple regression

I have a large regression problem with a lot of cases, but relatively few independent variables. One of them is a categorical factor with thousands of levels. Robust regression runs forever. In some ...
67 views

### Dummycoding based on clustering from OM distances

I'm using TraMineR to determine a certain clustering based on Optimal Matching distances: ...
78 views

### Variables selection (continuous and classification): how to do in R?

My dataset have both classification (categorical) and continuous variables, ~ 300 variables in all. I'm looking for a way to reduce my attributes to be less than 300 and put them in the decision tree ...
114 views

### Analysis to use with categorical response and categorical predictor variables

I have data from a randomized survey experiment in which each respondent was assigned to one of 4 groups, one of which can be considered a "control" or "no treatment" group. The key question asked in ...
697 views

### How to do regression with effect coding instead of dummy coding in R?

I am currently working on a regression model where I have only categorical/factor variables as independent variables. My dependent variable is a logit transformed ratio. It is fairly easy just to run ...
461 views

### How can I test the same categorical variable across two populations?

I have data that looks a little something like this: ID Status 01 A 02 G 03 E ... ... 100 G You get the idea, I ...
183 views

### RandomForest factor with too many levels

I have a model with about 200,000 training observations, where I am regressing, with 4 factors and 2 continuous variables. One of my features has 927 levels, which is causing the R implementation of ...
189 views

### Factor Scores of Ordinal Confirmatory Factor Analysis

I calculated a CFA with one latent variable; all four observed variables are ordinal. How can I compute the factor scores? Does anyone know a simple aproach? Some technical background: I'm working ...
371 views

### How does anova.lm in R calculates “Sum Sq”?

I'm learning R and trying to understand how lm() handles factor variables & how to make sense of the ANOVA table. I'm fairly new to statistics, so please be ...