8

First, I would avoid any stepwise procedures. That said: if I include an interaction term between mpg and type, is it appropriate to have an interaction for only certain levels of type and mpg, but not include all levels of type for the interaction. Normally you would just specify the model as carVal ~ mpg * type or equivalently: carVal ~ mpg + type + mpg:...


7

Usually we think of this type of data as a special form of categorical data called "ordinal", that is, ordered-categorical. This is because there is a natural ordering in the data: Underweight < Normal < Overweight. While it is sometimes useful to create categories such as these, there is a great loss of information by doing so. Edit: Based ...


4

A couple of options spring to mind. The first is a simple dot plot: HZ <- c(5,6,3,4,10,8,11,13) Cond <- c(rep("A",4), rep("B",4)) dt <- data.frame(HZ, Cond) library(ggplot2) ggplot(dt, aes(y = HZ, x = Cond, color = Cond)) + geom_point() The second is a boxplot: ggplot(dt, aes(y = HZ, x = Cond, color = Cond)) + geom_boxplot()


3

But now I have read that I cant use a factor in regression. I don't know where you have read this but there must be some misunderstanding. You can, of course, use a factor variable in regression models. So either I would have to use DAA as numeric variable or instead I would have to introduce dummy variables. When you use a factor variable in a regression ...


3

There is a clue that something may be off, which is embedded in the model summary: (30171 observations deleted due to missingness) That seems to be quite a large number of observations to be deleted from the model, so you need to investigate what is going on. First, I would start with a simple summary(USwave1) to see the extent of data missingness and in ...


3

You have two questions. The first question is in your title. How to report odds ratio for interaction between 2 categorical variables? The answer will depend on how many levels these variables have. I am glad that your both variables only have two levels, because this makes things a bit easier. So you have a two by two matrix where all observations fit. | ...


3

You really need to give more context to your question for a really useful answer. In general, questions like this are difficult to answer in the abstract, only some generalities can be said. I will assume your conflict event type variable is to be used as an predictor (I assume that is input in machine learning lingo.) Even if that variable can be ordered ...


2

The proposed model is not an ANCOVA. ANCOVA is a model with a continuous outcome, a categorical independent variable of primary interest (main exposure), and one of more continous variables that are potential confounders or competing exposures. The distinction isn't really important because it's just another (multivariable) regression model. So the model ...


2

Being able to Implement the code does not necessarily indicate that the strategy is ideal though! From what I understood your problem, there can be 2 different approaches. You will have to experiment with the performance of the model on the test dataset to choose the right one. A. Replace the null values with the not null mode of the corresponding columns B. ...


2

I like to show the raw data but use a method that scales to large N better than dot plots, so I use spike histograms stratified by the categorical variable. I add quantile intervals at the bottom of the histograms. If using R plotly graphics you can turn the quantile intervals off and on and likewise for the mean and median. An example may be found here ...


2

This idea may lead nowhere but hopefully will lead you to a useful idea. Think about stringing the data out into a tall and thin dataset with one row per month per client. For each row create 5 indicator variables with $Y_{i} = 1$ if product $i$ was used by the client in that week. Use a binary logistic regression model fitted separately for each product ...


2

If your test data has some levels that are an insignificant percentage of the population, but are just messing up your ability to make the model, here is an elegant way to remove the extraneous levels from the test set: uniquetrain <- unique( train$category) test <- test[test$category %in% uniquetrain,]


1

It will depend on how you code your categorical variable. Let's assume that short is coded as $0$ and tall is coded as $1$ ($0$ and $1$ are the standard ways to code the categorical variables, though you could switch which number corresponds to which category without changing much). It means that the tall subject is expected to be $\hat{\beta}_2$ more (in ...


1

The usual measure for vaccine efficacy ($VE$) is $1 - rr$ where $rr$ is relative risk. Relative risk is the ratio of disease incidence in vaccine protected people to those who are unvaccinated. That is the number you computed: \begin{align} VE &= 1- rr \\ &= 1-I_{vac}/I_{unvac} \\ &= 1- \frac{5}{15000}/\frac{95}{15000} \\ &\approx .947 \end{...


1

UCI Machine Learning Repository, maybe?


1

There are a few "classical" data sets that get used quite often for practice. From my experience some of the common ones are: The Iris data set The Auto MPG data set MT cars If you want more of a complete set of data from more of a real world field Kaggle is a very popular online community of users whose specific goal is to post real world data ...


1

The question didn't mention R and how to code this in R or any other software is off-topic here in any case. As an in-principle answer, consider also My point is not this example -- many other displays would work well too -- but some small principles that apply to posts like this. Box plots don't use the space available with 2 groups very well, and that is ...


1

Your question is somewhat unclear. You will be collecting polls for 4chan and otherchan (I will just use that designation here.) How many? You say Specifically, the data from each participant is not a ranking. For example, instead, for each participant providing their preference of fruit consisting of the options apples, bananas, and carrots, they simply ...


1

statsmodels now supports Ordinal Regression: from statsmodels.miscmodels.ordinal_model import OrderedModel see their documentation here


1

Low-rank decomposition is less straightforward for three-way arrays than two-way matrices, and less unique. One popular decomposition in chemometrics is PARAFAC, which writes an array $X$ as $$X_{ijk} =\sum_{f=1}^F a_ib_jc_k +e_{ijk}$$ and tries to minimise $e$, analogous to SVD in two dimensions. Here's a tutorial/review on PARAFAC Tucker decompositions ...


1

Since you have only two categories (M and F) then both the ordinal and nominal classification lead to 0 and 1 encoding so there is no difference. Whether you assign 0 to male or to female is just a matter of making the interpretation of the output easier so your decision based on Y chromosome is acceptable, I think.


Only top voted, non community-wiki answers of a minimum length are eligible