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
10 views

Meaning of Qqnorm plot in R

I am testing the normality of a sample with R using qqnorm. I obtain this: I understand that the meaning of this plot is that the sample has fat tails. But what is the meaning of the values on the ...
0
votes
0answers
12 views

How to compare forecasting methods: based on ARIMA and curve fitting?

I'm making a project connected with identifying the dynamics of sales. My database concerns 26 weeks (so equally in 26 time-series observations) after launching the product. I want to make forecast ...
1
vote
0answers
7 views

How do you interpret Ordinal Logistic Regression output without an adjusted R-squared Equivalent (and additional clarifying questions)?

I've gotten fairly good at multiple linear regression recently, and I'm now trying my hand in ordered logistic regression -- but I'm having trouble analyzing some of the results. Anybody who could ...
1
vote
0answers
14 views

How to Obtain “Right” Parameters of Multinomial Logit Model (or Other Conditional Models) in R?

I started to use the function multinom of R package nnet in order to fit several conditional ...
5
votes
1answer
44 views
1
vote
0answers
17 views

Plotting fitted values for an nlme model

I just got the output of my lme (nlme) model called shalit5 with syntax: ...
0
votes
0answers
8 views

Construct matrix of stacked variables in VAR regression

I am trying to NOT use packages for the estimation of models in order to have a deeper understanding of how things work. Currently, I am trying to estimate a VAR(1) (vector autoregression of first ...
0
votes
0answers
22 views

Help interpreting R linear model fit [duplicate]

I have observed variables power$values. I am trying to model this process using a second set of observations, such that $P = M\cdot X + B$. $P$ is the function ...
1
vote
0answers
5 views

lme / lmer - split-plot with Non orthogonal subdesign

I have an agricultural field experiment (testing a plant protection agent): Split plot design with: ...
1
vote
2answers
39 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
2answers
25 views

what does the correlation of Random forest regression tool in R represent

I've built a random forest model (regression model) using randomForest package in R, and I calculate the correlation between the predicted values and the actual ones in order to know how the trained ...
0
votes
0answers
13 views

Lsmeans: Is this what I did?

after doing the linear mixed model with lme4, I have used lsmeans for pairwise comparison with this command: lsmeans(lmer52, pairwise~color, adjust="tukey") I am ...
0
votes
0answers
22 views

Fitting an ANOVA with too many predictors in R. No p-values but how can I still interpret the model?

So I've fit an ANOVA model to 32 predictors and 32 data points. The summary output simply gives me the SS for each predictor and no F-stat or p-value. Is there any way to still make some sort of ...
0
votes
0answers
28 views

How to do Regression Discontinuity Design in R [on hold]

I am having trouble with doing regression discontinuity design in R. Could anyone show me a syntax for R to do RDD? The exercise I have is y= wealth x=winning margin covarites= education, past ...
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, ...
0
votes
0answers
15 views

What is the limit of variables that can be used in R to create matrix scatter diagrams? [on hold]

R crashes after trying to create a matrix scatter diagram with 47 variables that are in a CSV file being read by my R workspace. I have already set my limit number to NA by using limitNo=NA which ...
1
vote
1answer
48 views

Constants in a DLM Model R

Good afternoon, I am attempting to fit a state space model of the form: $$ (S_t- \mu) = G*(S_{t-1} - \mu) + E_t $$ $$ Y = F*S_t + v_t $$ Where $Y$ is nx1, $G$ is 3x3, $S_t$ is 3x1, $\mu$ is 3x1, and ...
0
votes
0answers
17 views

Calculate first difference by group in R [migrated]

I was wondering if someone could help me calculate the first difference of a score by group. I know it should be a simple process but for some reason I'm having trouble doing it..... yikes Here's an ...
0
votes
0answers
12 views

Nonempty Numeric vector? [migrated]

So I run this loop: (my data file is very big, .csv) ...
0
votes
1answer
48 views

I want to learn about ROC curve — what is the canonical textbook?

I want to learn about Receiver-Operator-Characteristic curves, and metrics. I have read through online webpages with some basics, and I have used MATLAB built-ins to create ROC plots. It tells me ...
0
votes
0answers
11 views

warning message from ezANOVA function in R [migrated]

I am new to R and I am trying to use ezANOVA to do a repeated measure factorial anova. So I have a data frame named mus.df, which looks like the following (with more rows): ...
1
vote
1answer
24 views

code needed for p values in GLMM

I need to get p values for the fixed effects in the following GLMM's I ran. Does anyone know of code that I can run that will give me the p values I need? At the moment the output from the ANOVA only ...
4
votes
2answers
39 views

Absolute (i.e., not just relative) probabilities in chi-squared test for proportions

Why do the absolute probabilities affect the p-value of a chi-square test so much? For example: ...
0
votes
0answers
19 views

Problem with year as a factor GLMM

So I need to do a GLMM, I do it this way, with package lme4 glmer(y~x1+x2+x3+year+(1|x4),family=binomial In my data, year is a factor (4 levels). So when I run my glmer, I have my result like this x1 ...
0
votes
1answer
41 views

Transformation of latitudes to include them a linear model

I have in a dataset a variable latitude that contains values such as 39° 37' 39" N and ...
3
votes
1answer
107 views

Manually calculated chi-squared statistic differs from that given by chisq.test in R

I'm using R to do a chi-squared test on two sets of data to check if they follow a distribution. In the first case the chi-squared statistic given by chisq.test ...
1
vote
0answers
26 views

Fit a GARCH (1,1) - model with covariates in R

I have some experiences with time series modelling, in the form of simple ARIMA models and so on. Now I have some data that exhibits volatility clustering, and I would like to try to start with ...
0
votes
0answers
16 views

How to merge datasets in STATA conditionally? [migrated]

I have written a program which runs fine in R. But I need to convert it to STATA, in which I am relatively new. Since STATA allows you only to run a single dataset, I need to merge the data. My first ...
0
votes
1answer
27 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
23 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
25 views

denoising using R or matlab [on hold]

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
18 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
21 views

Fit and predict logistic regression model for censored data?

Suppose I have a data frame such that: ...
1
vote
3answers
124 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
23 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 ...
0
votes
0answers
14 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
33 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
17 views

Measured 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 measured satisfaction variable [SV] (besides the measurement ...
2
votes
0answers
69 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
13 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
0answers
16 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
50 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
23 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
52 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( ...