Use this tag for any *on-topic* question that (a) must have an `R`-based solution yet (b) is not *just* about how to program in `R`.

learn more… | top users | synonyms

0
votes
1answer
29 views

Trying to use Holt-Winters to fit this data

I'm trying to fit the data in this message (daily temperatures) using a Holt-Winters technique in R, but can't get the seasonal example in here to work ...
0
votes
0answers
18 views

How to fit a model for a censored binary outcomes?

Suppose I have a data frame such that: ...
4
votes
1answer
24 views

Using log-linear models for presence/absence data in wildlife

I'm working on a project wherein I compare the presence/absence of a number of bird and herptile species between wetlands that have received three different treatments. The populations were surveyed ...
0
votes
1answer
29 views

Ways to simplify a neural network in R for interpretation

I would like to try to make some sense of a neural network. The neural network has a single hidden layer and is used on 30-40 attributes, which are used to classify the probability that the ...
-2
votes
0answers
26 views

denoising using R or matlab [closed]

How can I use R or matlab to denoise data using the following smoothers 1) wavelet 2) epanechnikov kernel 3) polynomial spline 4) logistic kernel.
0
votes
0answers
20 views

What is the sampling design and how to declare it in the survey()

I have a sample design that can be resumed in: Split the city in X areas and, for each area, sample 5% of the residences and get some informations about it; For each residence, interview ALL ...
1
vote
0answers
24 views

Fit and predict logistic regression model for censored data?

Suppose I have a data frame such that: ...
1
vote
3answers
135 views

Monte Carlo integration help needed

I'm trying to simulate these two integrals using Monte Carlo simulation: $$ \int_{-\infty}^\infty \exp(-x^2) dx, \quad \mbox{and } \int_{-\infty}^\infty \exp(-|x|) dx . $$ When I use ...
0
votes
0answers
25 views

Cannot do Tukey test in multcomp

After performing series of linear mixed models in lme4 to justify which model with which level of interaction to be used, now I would like to do the Tukey's test for multiple comparison. So first, I ...
1
vote
0answers
21 views

lmer() parametric bootstrap testing for fixed effects

I am performing a parametric bootstrap to test whether I need a specific fixed effect in my model or not. I have mainly done this for exercise and I am interested if my procedure so far is correct. ...
0
votes
0answers
18 views

Two-way interaction: interpret output from LMM in lmer

I have asked a question in this topic relating interpreting two- and three-way interactions in this link: How to interpret 2-way and 3-way interaction in lmer? ...
0
votes
1answer
25 views

Change in output depending on mirt version

I have a matrix which I'm trying to run through the mirt function of the mirt package: ...
1
vote
0answers
34 views

Posterior Density in R

I'm new to the site, and to Bayesian statistics and was hoping to get some help. I'm currently working through some study exercises and am required to compute the mean and variance of the posterior ...
2
votes
1answer
35 views

Observed variables in R's lavaan

I am running a SEM on lavaan in R. The model consists of latent variables [N1 to N3], two dummy choice variables [du1 and du2] and observed satisfaction variable [SV] (beside the observed variables). ...
2
votes
0answers
71 views

How to get the regression from a plot?

I have a dependent variable C and an independent variable VPT. VPT is the average volume per ...
0
votes
0answers
14 views

Confirmatory factor analysis about technology acceptance model in R

I tried to do a cfa with lavaan package in R. I'm not sure, if SO is the right stackexchange plattform, if mathematics fits better just tell me and i will move it. Here is my model: I know how to ...
0
votes
1answer
29 views

Confirmative Factor Analysis with R lavaan

i tried to do a cfa with lavaan package in R. I'm not sure, if SO is the right stackexchange plattform, if mathematics fits better just tell me and i will move it. Here is my model: I know how to ...
1
vote
0answers
51 views

Reading the output from a GLMM run in R

I am a complete novice and dummy when it comes to statistics so I apologise in advance... I have been asked to report the results of my GLMMs (I ran two) in a table. This table must state: effect, ...
0
votes
0answers
5 views

Setting Contrasts for ANOVA in R [migrated]

I've been attempting to perform an ANOVA in R recently on the attached data frame. My question revolves around the setting of contrasts. My design is a 3x5 within-subjects design. There are 3 ...
1
vote
1answer
25 views

Meta-analysis of RR and OR calculated from 2x2 tables in R using metafor

Background My question concerns the calculation of risk ratios and odds ratios for meta-analysis using the metafor package. I know it looks long, but please bear ...
1
vote
0answers
29 views

Leaps() or AIC for model selection

I am deciding how many predictors to include in my model - I currently have 4. When I use the leaps() function, the smallest value for the residual standard error ...
1
vote
1answer
53 views

Interpretation of Maximum likelihood estimation

I have some problem to interpret the result of MLE estimation : Is it possible to get some advise about how to interpret it? the log likelihood function : $\sum^{n}_{i=1}\log\left( \phi\left( ...
2
votes
1answer
62 views

Non parametric Wilcoxon Signed Rank test

I have the following data vector(in fact its 2392 data points long): ...
9
votes
1answer
159 views

Testing whether two regression coefficients are significantly different (in R ideally)

If this is a duplicate question, please point to the right way, but the similar questions I've found here haven't been sufficiently similar. Suppose I estimate the model $$Y=\alpha + \beta X + u$$ ...
1
vote
1answer
39 views

Strange results in Holt forecast

I am trying to understand what could be causing these strange values to appear on applying a Holt model to a vector. The data represents actual sales of an item. ...
0
votes
0answers
8 views

How do you map every combination of categorical variables in R? [migrated]

Using R, is there a way to take a data set and map out every possible combination of every categorical variable? For example, let's say I had 10,000 rows of customer data from an online shop. I want ...
1
vote
2answers
51 views

Homoscedastic and heteroscedastic data and regression models

How to understand the homoscedasticity and heteroscedasticity in context of regression models? Is there a way to check these properties in R?
4
votes
2answers
69 views

How do I run Ordinal Logistic Regression analysis in R with both numerical / categorical values?

Base Data: I have ~1,000 people marked with assessments: '1,' [good] '2,' [middle] or '3' [bad] -- these are the values I'm trying to predict for people in the future. In addition to that, I have some ...
0
votes
1answer
31 views

Find the midpoint of S-curves with R

I have a bunch of curves that look like S-curves (stored in a db with Point format) and I am interested in finding this midpoint between both horizontal asymptotes for each of them. So, if X-axis ...
0
votes
0answers
24 views

How to estimate the effect of changes happened in employee designation/title on salary?

Is it possible to estimate the beta changes corresponding to employee's departmental change or title change or Both. Can i follow linear regression directly to calculate slope ? I am using R ...
0
votes
0answers
21 views

How do you extract confidence intervals and OR out of the step() function in R?

I've been wondering something for a while. If you run a simple regression model in R and then perform a step-wise selection (it doesn't have to be the way I typed the code below), how do you extract ...
0
votes
2answers
56 views

Variable Selection [duplicate]

I am using R/RStudio to code a regression (and to optimize the function) over 50+ different variables. For the optimization to work I need to fit a higher order function (I am not sure to what degree ...
0
votes
0answers
3 views

How to create three-way interaction graph in R (I have example of graph)? [migrated]

I would like to create this kind of graph for my data (categorical IVs and continuous DV). How can I find the formula that helps me to run this?
0
votes
1answer
25 views

Investigating relationships between variables- multiple and simple linear regression

please help a sociologist struggling to get to grips with R and statistics in general..! I've got a data set with 11 variables. I need to investigate the possible relationships between one of the ...
0
votes
1answer
23 views

How to interpret coefficients in a Poisson regression with interaction terms?

This question is a prolongation of this question: How to interpret coefficients in a Poisson regression? If we follow the (almost) exact same routine, but we add correlation between the variablese ...
2
votes
0answers
20 views

Statistical method to find capacity limits?

Im analyzing time-series to detect when the y-value is so flat that one can assume there is an underlying factor limiting y from being higher. Is there a methodology or statistical discipline that do ...
4
votes
2answers
182 views

Data mining techniques in R for advertising and sales data

I would like to apply one or more data mining techniques to a dataset, in order to see the effect advertising has on sales. I am working from this dataset. It has 36 consecutive entries of monthly ...
0
votes
0answers
15 views

Model selection based on bic.glm function output and K-fold cross validation

I'm looking for a logistic regression model with high prediction power, and the best model returned by the bic.glm function has a posterior probability of 0.348. I ...
0
votes
0answers
23 views

using stepAIC of MASS package to select variables with a significance level of 5% in R project

First of all, sorry i am new about this and any helps are really welcome. I am reading a reaserch paper where the authors report: Stepwise forward regression (Zar 1996) was used to select the most ...
3
votes
1answer
55 views

Understanding coefficients in summary output of logistic regression in R

This question is about understanding the logistic regression output using R. Here is my sample data frame: ...
0
votes
1answer
28 views

compare models using anova in r

I got the following outcome. I am confused with the interpretation. When I consider RSS then model 2 is better than model 1. What does that high p value mean? Does in influence my conclusion?? ...
0
votes
0answers
27 views

how to compute odds ratio

Given a generic classification model $y=f(x_1,x_2,..,x_p)$ where $y\in \left\lbrace 0,1 \right\rbrace$ is it possible to compute the odds ratio for each variable? A theoretical explanation and ...
2
votes
0answers
49 views

Modeling the shape of the power function

In cognitive psychology, it has been argued that the learning curve of a skill follows the power function, in which the practice of the skill yields progressively smaller decrements in error. I want ...
2
votes
1answer
32 views

Wilcoxon rank sum test methodology

I'm comparing the performance of two algorihtms $A$ and $B$ based on a metric. For each algorithm, I have $31$ independent samples that represent its performance. This samples are grouped in two ...
1
vote
0answers
13 views

Pre-stimulus baseline removal in R

I have the following scenario: trials were conducted where participants were exposed to multiple stimuli during the course of a trial a specific physiological response was continuously recorded ...
0
votes
0answers
34 views

Fitting non-normal data in lme4 with a family distribution

I'm currently working on fitting a model where we predict the level of some biomarker as a function of time (see image at bottom). I have two difficulties: Each person contributes 2-3 datapoints ...
3
votes
0answers
29 views

Error in fitting negative binomial regression model in R when replicating published results (works in Stata)

I'm trying to replicate the results of the first model of this article: Hultman, Lisa, Jacob Kathman, and Megan Shannon. 2013. “United Nations Peacekeeping and Civilian Protection in Civil War.” ...
0
votes
0answers
9 views

How do I partition variance among nested random effects for non-normal data and an unbalanced design?

I have a dataset of plant drought tolerance values (called TLP_DRY) that I would like to partition variance for among the nested levels Biome/Study site/Species to figure out whether most variation in ...
0
votes
0answers
17 views

How to avoid writing the same line several times in R? [migrated]

I'm writing a program in R and I need to select variables based in a particular value of one of the variable. The program is the next: ...
1
vote
2answers
63 views

Time series analysis: Determine if trend is deterministic fluctuating/stable or stochastic

I am analysing sales data of certain products and need to determine if the demand trend is deterministic fluctuating or deterministic stable or stochastic. How do I do that in R / what approach is ...