# Tagged Questions

9 views

### Is my Poisson regression correct?

Here are my data: ...
10 views

### Finding subsets with Branch-and-bound techniques

Hello I am trying to find a Matlab version of a function which performs best subset selection for least squares regression using leaps and bounds (branch and bound) approach. Like in the paper by ...
11 views

### Coefficients from a penalized Cox PH

I'm using the R package Penalized (0.9-42) on a Cox PH model. I'm using L2 (Ridge) on the grounds that I don't want to shrink my coefficients to 0. I don't understand why when I ask for: ...
61 views

### Best modelling packages in R?

In R I use a lot the packages plyr, stringr, Hmisc and ggplot2. Each of these packages take the base code and make functions that are more intuitive and easier to work with. Each of these packages ...
24 views

### Conditional Logistic Regression, Rare Events and R

I have a panel data set organized around 35 provincial units, with 110 binary "positive" outcomes in the dependent variable. This is for about 2600 observations in that data set. I have a couple ...
14 views

### Mean residual life with censored observations and covariant eps

I have a time variable ( time of claim settlement after occurrence ) that may be censored ( claim still open at the moment of observation) and some additional covariates ( line of business, claim ...
29 views

### Estimate duration using categorical data

I have a dataset of tasks. Each task: has a duration (difftime in seconds) belongs to a project (project name factor) has an owner (user name factor) In R , I can simulate my data by something ...
57 views

### Regression for outcomes truncated from both sides

I have an outcome which is truncated from both left and right sides. I would like to know which regression method may account this kind of analysis. Here is an example: ...
63 views

### Interpret interactions and logarithms in linear regression

I'm currently playing around with linear regression in R, and I've come up with a regression that fits data quite well. I'm just having some problems with interpreting the coeffiecents of my model. I ...
43 views

### Regression tree algorithm with linear regression models in each leaf

Short version: I'm looking for an R package that can build decision trees whereas each leaf in the decision tree is a full Linear Regression model. AFAIK, the library ...
63 views

### How to make linear regression model while 'control' confounding variables?

I have data from survey, and Trying to build a linear regression model using R like A~ B however, want to control C, D, E, F, G. like Age, Sex, and other confounding variables. I tried to make some ...
29 views

### Compute the inverse of function [closed]

I want to compute and plot the inverse of given function f. I have the following code in R : ...
41 views

### Nonlinear regression: best transformation when getting very different parameter estimates

Disclaimer: Statistics is not my strong side, so if my question is nonsense I apologize. I'm a beginner, but really wanting to understand this. My question is: why do I get so widely different ...
55 views

### Estimate specific y value in linear multiple regression using R

I am trying to find specific y value of fitted regression model using specific x value. for example, in the multiple regression model like below, y~ aX+bZ+cW +error I fitted the model with data ...
22 views

### Find specific 'y' value from GLM-fitted segmented multivariate regression

I loaded the data to R and fitted it using GLM function. fit.glm = glm(y~ aX+bZ+cW) Then, I found the cuttinf-point using "segmented" tool of R. o<-segmented(fit.glm,seg.Z=~X,psi=10) ...
7 views

### R: merging two data frames such that when there are duplicates, one dataset passes on the information [migrated]

I used a data frame ($trind$) to train a machine learning regression that made predictions ($pred$). The $pred$ matrix is 100 times larger than the $trind$ matrix, but there are overlaps between the ...
47 views

### How to spot if model is zero inflated?

I'm running a linear regression. The response variable is a proportion, and has quite a lot of zeros. The predictor variable is normal distributed. My two variables look something like these: ...
153 views

### Fitting data to describe data the best way

This data is for a company who wants to minimize their expenses. The expenses is described out of the production costs . (Production, salary, capital and material prices). I need to create a ...
21 views

### Cause of singularity in matrix for quantile regression

I am performing quantile regressions in R using the package quantreg. My dataset includes 12,328 observations ranging from 0.12 to 330. The timepoints for my data are not exactly continuous; all data ...
50 views

### How to check for interaction of all pairs of variables, in linear regression in R?

I am fitting a linear model in R with many variables: lm(Y~X1+X2+...+X100) I want to check also for all pairwise interactions. Writing ...
44 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 ...
47 views

### Find trendline for minimum (not mean) values in distribution

I would like to perform something like a linear regression on my distribution of data, but I'm interested in a trendline that estimates the minimum, not mean, value for each time bin. I'd like to do ...
67 views

### How to describe the failure of this linear modelling?

I have a time series $X_t$, which is shown in the first plot. In the second plot, I am doing a linear regression on $X_t\sim X_{t-1}$. The regression line is very close to $y=x$. But this is tricky ...
62 views

### Finding optimal cutoff point with two linear regression models

I am trying to get an optimal cut-off value dividing group with minimum sums of squares of residuals (=observed y - estimated y) the model is like below. In group 1 : model y= a1x + b1z + C1v ... ...
53 views

### How to distinguish these two linear regressions?

I have two linear regressions. The linear coefficients of both of them are very close to $1$. The first plot seems reasonable linear regression, while the second one is tricky since if the bottom left ...
67 views

### Negative Binomial “Process”

I wish to model the number of bugs caused by software development. This is intuitively sort of a Poisson process, however it is overdispersed. One thing we can do in this case is to use a negative ...
123 views

### How to check if my data fits log normal distribution?

I'd like to check in R if my data fits log-normal or Pareto distributions. How could I do that? Perhaps ks.test could help me do that, but how could I get the alpha and k parameters for Pareto ...
63 views

### How interactions between explanatory variables can be found using binary recursive partitioning?

I would like to investigate interactions between my explanatory variables prior to building a statsitical model. Apparently it is possible to do it in R using a regression tree (library: tree). This ...
26 views

### What's the difference between the output of Ridge regression with linearRidge in ridge package and lm.ridge in MASS package?

When I fit a ridge regression, in the example that I show in below, with the same lambda=0.1 the estimated coefficients from the ridge package and MASS package are different. What's the difference? ...
68 views

### Shanken (1992) correction for t-statistics

I have done a cross-sectional regression of time-series average returns on estimated Betas (over the same time horizon) to determine average premiums. So far so good. But I was told that the standard ...
56 views

### Linear model fit seems off in R

I'm posting this in this forum because I think the question is related to stats. If it's not, I'm fine with it being moved over to Stackoverflow. I have data in R and am trying to fit a linear model ...
58 views

### How to interpret glmnet?

I am trying to fit a multivariate linear regression model with approximately 60 predictor variables and 30 observations, so I am using the glmnet package for regularized regression because p>n. I ...
74 views

### How do I get the amplitude and phase for sine wave from lm() summary?

A simple sine curve could be written as $\text{amplitude}\cdot\sin(x+\text{phase})$. It can be also written in linear form as $a \cdot \sin(x) + b \cdot \cos(x)$. I run my analysis with R as: ...
66 views

### Logistic regression prediction validation

I am try to evaluate a logistic regression with new data using R. I have created the logistic regression using the old data and evaluated that using chi^2 etc. i.e. ...
51 views

### How to remove one of the factor from the model?

We have a variable "pos" in the regression which has three values : guard, forward, and center. My regression looks like y~a+factor(pos) But one of the factor's value is insignificant (i.e. forward). ...
219 views

### Comparing nested binary logistic regression models when $n$ is large

To better ask my question, I have provided some of the outputs from both a 16 variable model (fit) and a 17 variable model (...
58 views

### Correct model to use in travel speed analysis

I am attempting to analyse downstream travel speed of fish within two different rivers, however, I am getting lost on which model I should use. Please see working below data: ...
48 views

### How can I estimate optimal cut-off using linear regression-models

To build two linear regression model, (dependant var : B, independant vars : A1, A2, A3) I have to set the cut point of A1. (high A1 and low A2) I want to pick up the model*s*(a model for high A1, and ...
74 views

### Mixed-model or not? Case-study in R

I performed some observations of clownfishes. For each individual fish (each observation), I recorded the anemone species where it lives, the size of the anemonea and the size of the fish (and many ...
48 views

### symmetry of linear regression

Consider the following linear regressions on two sets of data x and y (of same length) y=ax x=by As you know, the usual optimisation by OLS is usually not giving (at all!) b=1/a This is because ...
55 views

### How to do mixed logistic regression with multiple repeated measures in R?

I have data from a psychology experiment in which participants were assigned to one of 3 training conditions and then gave responses for 16 trials for each combination of two within-subjects factors, ...
23 views

### conditional logit model will not converge

I am running a conditional logit model and it will not converge! The DV has 6 levels of vote choice, essentially parties one can vote for, and I've got one predictor, individual level economic ...
33 views

### Running multiple for loops for multinomial regression in R

I'm using the ANES dataset, which is a repeated cross-sectional study of public opinion and knowledge. I am trying to predict knowledge by individual level characteristics. The data is organized by ...
89 views

### Diagnosis of normality assumption and fitting linear regression in R

I am using the data veteran from R package survival. How can I diagnose the normality ...
61 views

### Visualising a linear model using effects package in R

I have ran this model in R: model <- lm(mpg ~ hp + drat + disp, data=mtcars) And I have visualised this model using ...
16 views

### Simulation setting for the average treatment effect on the treated (ATT)

I have a question about a simulation set up. Assume there are two groups (Z = 0 and Z = 1). The outcome for Z = 0 and Z = 1 are generated by the following equations: \$Y_0 = \alpha_0 + ...
43 views

### Regression analysis in R using text field?

I'm working in R. I'd like to run a regression analysis for predicting price against terms in a text field. I have a dataset of jewellery auction listings, with price paid, date, and an unstructured ...
16 views

### How to obtain SE for covariates that enter a regression directly and through a interaction term?

How to obtain SE for covariates that enter a regression directly and through a interaction term? Any suggestions of how to interpret the statistical significance of covariate that enters a regression ...