Use this tag for any *on-topic* question that (a) involves `R` either as a critical part of the question or expected answer (b) is not *just* about how to program in `R`.

learn more… | top users | synonyms

0
votes
2answers
26 views

TukeyHSD multiple comparison on binomial data using Multcomp package in R

My question is how to perform TukeyHSD multiple comparison on ratio(for example, conversion rate, graduate school admit rate) using multcomp package in R. Take UCLA admission data for example: ...
0
votes
0answers
11 views

Obtaining summary statistics using arima in R [closed]

I want to estimate a sarima(1,1,1) model for the Employment in the agricultural sector (time series from 1998Q1 until 2014Q2 in Italy, using R. I programmed the code below: ...
1
vote
2answers
52 views

Wilcox.test in R

I have tried to identify differential expressed genes between two sets of Microarray samples by running wilcox.test for each gene, but the p-values of most of the ...
1
vote
0answers
5 views

high variable significance and low r-sqaured [duplicate]

So I have built a linear model on the yelp business dataset. ...
0
votes
0answers
13 views

Automatically classifying user activity/sessions on a website?

X-posted from Stack Overflow: I have a large body of records pertaining to user activity on a website. What I want to do is some sort of classification on each user as they navigate my website. Every ...
1
vote
0answers
26 views

Definition of AIC in ARIMA() function in R?

I wonder how the Arima() function in R computes the AIC. Applying the standard formula AIC= 2*k - 2 LN(L) (with k number of parameters and L maximized value of likelihood) doesn't reproduce the ...
0
votes
0answers
11 views

bestglm starting values error

I am trying to get the best subset regression for a gamma glm, so I am using the bestglm package, but this error continues appearing: ...
1
vote
1answer
19 views

Calculating CI and SD for individual regression lines from a multiple factor glm

We have 2 correlated variables and a lot of binomial factors (around 200), here illustrated with just $f1$ and $f2$: ...
0
votes
1answer
32 views

Predicted lm() means of log-transformed and untransformed data not equal

Why is the back-transformation of the predicted values so different from the observed when the observed are log-transformed? Sample data: ...
0
votes
1answer
10 views

Automatically classifying user activity/sessions on a website?

I have a large body of records pertaining to user activity on a website. What I want to do is some sort of classification on each user as they navigate my website. Every algorithm I found so far uses ...
0
votes
0answers
15 views
2
votes
3answers
126 views

Bootstrap two-sample t test

I'd like to bootstrap a two sample t-test. My DV is some psychological variable. I have two groups (women and men), unequal sizes and I do not assume equal variances. I'm not sure if my code or/and my ...
2
votes
0answers
33 views

Propensity Score Matching in R with Multiple Treatments

I commonly estimate Average effect of Treatment on the Treated (ATT) via Propensity Score Matching for a particular business use case. I'm currently using R, where ...
0
votes
0answers
35 views

Fitting logistic function in R, response unconstrained to 0 < Y < 1

I want to fit a logistic function of the form $$f(t) = \frac{C}{1+ab^{-t}}$$to some data that I have, using R. There is some uncertainty to $f(t)$, and its ...
2
votes
1answer
34 views

Correcting for spatial autocorrelation in dissimilarity datasets

I have a community assembly dataset with 299 species at 15 sites. Im interested in correcting for the effect of spatial autocorrelation on beta-diversity (or species turnover). Dataset here. There is ...
0
votes
1answer
26 views

Multi level regression with interaction using R lme4

I'd like to do a regression analysis with interactions, my data has two levels (school classes and pupils). My variables are: Predictor = dummy variable on Level 1, dependent Variable = metric on ...
1
vote
1answer
22 views

techniques for sampling graphs? (possibly implemented in r packages)

Let's say I have a very large graph that proves impractical for visualization ends and I wanted to sample a random subgraph. (I know that I can filter out a subgraph via measures like degree, ...
4
votes
2answers
29 views

Should I take the Shapiro Wilk test with a pinch of salt here?

So I'm trying to determine whether the residuals from a seasonal ARIMA model are normal or not. Upon using the shapiro wilk test, I get a staggeringly low p-value leading me to think that the ...
0
votes
0answers
15 views

needing to color points according to gender when plotting height~weight in R [migrated]

I am trying to make a scatter plot for class. The final question ask for me to make a scatter plot showing if height and weight are significantly related, but the professor wants an illustrative ...
0
votes
0answers
21 views

KPSS test in R interpretation

So in the R package tseries's kpss.test function, it seems I can specify whether the null hypothesis is trend stationary or level stationary(default). ...
4
votes
3answers
56 views

what is the algorithm of getting maximum $D$ value in ks.test?

When I was writing R code to plot two empirical cumulative density curves, I came across ks.test in R. I looked into the code of ...
0
votes
0answers
7 views

How does 'locfit' choose its smoothing parameter?

I would like to know how 'loess' and 'locfit' functions in R choose their smoothing parameters. 'loess' help file states that "For α < 1, the neighbourhood includes proportion α of the points, and ...
0
votes
0answers
17 views

Ridge Logistic Regression in R [on hold]

I write the code for Iterative Newton Raphson for logistic Regression. Now I need to use the Ridge logistic regression. Any help to edit the code to have the coefficients after applying Ridge. And the ...
0
votes
0answers
14 views

MIDAS Forecasting in R, using midasr package

I am attempting to provide a forecast on yearly data using monthly data as a regressor variable via the MIDAS regression from the midasr R package. Here is my data: y is yearly data ...
1
vote
0answers
19 views

Observation/case weighting in cluster analysis

Sampling weights, the inverse probability of a unit's selection into the sample, and other more complex and adjusted weights are very often used in the social sciences. There is statistical software ...
0
votes
1answer
34 views

Adjusting for multiple Kruskal-Wallis tests

I've run 3 different machine learning algorithms on 10 different datasets, generating an accuracy on each one. My hypothesis is that two of the algorithms are consistently better than the third. I've ...
3
votes
2answers
63 views

How to determine whether a variable is significant using Pr (>Chi) and Df?

I wonder how can I determine whether a variable is significant using Pr (>Chi) and Df? Take following ANOVA table as an example, I know variable type is ...
1
vote
1answer
43 views

Understanding RPART model results

I have operational fault data and maintenance data. The operational fault data was used to determine if the maintenance improved the fault indicator (true/false). The maintenance data was used to ...
2
votes
1answer
38 views

Eigenfaces in R: How to reconstruct original features from principal components? [duplicate]

I've performed PCA on face images dataset and I'm not sure how can I use the most informative principal components to show the "reduced" image. The original image is 96*96 pixels (96*96 = 9216) and I ...
0
votes
1answer
54 views

F-test for dummies

Assume following model: $Sales_i = a +b_i*Price*Dummy+Advertsing*Dummy$ $Sales_i$ represent the sales in retailer i (either 1 or 2) and $Dummy$ is a dummy variable giving value 1 to retailer 2 and 0 ...
5
votes
0answers
65 views

glmer in R: Significance estimates are not robust to order of data frame

I'm using a mixed effects model with logistic link function (using lme4 version 1.1-7 in R). However, I noticed that the estimates of significance for fixed effects change depending on the order of ...
0
votes
2answers
24 views
0
votes
2answers
70 views

How to make prediction in survival analysis using R?

I have fitted a survival model in R which is below. However, I am not sure how to make predictions. I tried predicting the survival probability that a patient whose design matrix is ...
0
votes
0answers
6 views

How can i plot two gbm objects in partial dependence plot using gbm.plot() in Package dismo in R? [migrated]

How can i plot two gbm objects in partial dependence plot using gbm.plot() in Package dismo in R? or other package?gbm? ...
1
vote
0answers
18 views

R: Bitmap output in PDF [migrated]

A lot of the time, I find it very useful to output graphics with pdf() as it allows me to scroll through pages and observe subtle differences (e.g. the page numbers ...
2
votes
1answer
45 views

Mann-Whitney U test when only summary data (mean, sd, sample size) are available

When raw data is not available, which normally occurs when we obtain our data from different scientific papers, how is it possible to perform a Mann-Whitney analysis to test whether two samples are ...
2
votes
1answer
17 views

Check a status of training process in R

I'm training a model using caret package in R for almost 3 days. The calculations are running in parallel (multiple processes). Unfortunately there is no output in ...
2
votes
1answer
33 views

Initialize AR(p) process by using Arima.sim

Hi I am currently trying to simulate an AR(4) process $y_t=0.67y_{t-1}-0.51y_{t-4}+\epsilon_t$ given that the initial value $y_1=1,y_2=2,y_3=3,y_4=4$ and $\epsilon_t\sim N(0,1)$. My code is given as ...
0
votes
0answers
18 views

Decision Tree Modelling

Can anyone explain me about Decision tree parameters - minSplit, minBucket, Complexity, minDepth with some simple decision tree example? And how this parameters will affect the accuracy measure? ...
2
votes
2answers
69 views

Modelling Technique

I have a 5 years of Cargo insurance (goods transportation insurance) data. I need to predict the claim amount based on their policy date and some other variables like mode of transportation, Country ...
3
votes
3answers
347 views

How to think about correlation

I have data that looks like this (I am using R): ...
3
votes
1answer
41 views

Dealing with Postcode in Regression

I'm building a logistic regression model and one of the variables I have is postcode, I might be over thinking this but is it fine for me to leave postcode as is and regress it as: ...
3
votes
0answers
31 views

simulate GLM with square root link in R

I'm trying to simulate a fitted GLM using basic functions, not using the simulate() and predict() functions that are widely questioned and answered. I get different results when I compare my math ...
0
votes
0answers
23 views

How can i do time series forecasting with missing data

I am relatively new to time series forecasting, I have worked previously with continuous data at regular intervals successfully, Now I have a data set with missing values, for example look at the ...
2
votes
0answers
19 views

variable reduction before doing random forest in R

I have a dataset featuring around 50 predictors, some of which are correlated. Now I am trying to fit a random forest model in R for prediction purpose with this dataset. Because there are too many ...
1
vote
1answer
62 views

R forecasting, flat forecast

I’m trying to produce a hourly, daily forecast for revenue in R. I set seasonal periods to 24, for 24 hours, and 365.25 for days in a year. I attached the fit vs actual plot and the forecast produced ...
0
votes
1answer
35 views

Method to identify the point in which the slope of a predicted probability becomes significant

I'm running a logistic regression in which I'm predicted a binary response from a continuous predictor... I'm interested in determining the exact point in which the predicted probability ...
1
vote
0answers
25 views

auto.arima prediction

I have this time series of call volume of a contact center. It is composed of 15565 points where every 48 points represents one day. I used 12960 points as training set for the auto.arima model. ...
6
votes
1answer
40 views

How to tell that a reciprocal relationship exists by a residual plot?

I'm following an example from the book "R by Example", where they talk about two-way ANOVA. The database used in poison. The analysis is: ...
4
votes
0answers
23 views

How to decide the p and q for GARCH model?

My question is simple. When shall I stop when trying the value for p and q? I have got the loglikelihood from ARCH(1) to ARCH(10). It's increasing. And then I tried GARCH(1,1), GARCH(2,1) etc. The ...