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

2
votes
0answers
48 views

How to work with an improper uniform prior in R?

I'm coding some Bayesian bandits algorithms for exponential families and for the case when my rewards are normally distributed, I need to use an improper uniform prior. Is there any way to represent ...
1
vote
1answer
137 views

Time-series forecasting (in C#)

I'm developing an app in C# (WPF) that amongst other things, it makes a time-series based forecast of sales (4-5 months into the future). I'm an industrial engineer so I'm not pro in statistics nor in ...
0
votes
0answers
22 views

Question for constructing hypothesis test

I am trying to construct a hypothesis test for the $p$ parameter of Bernoulli distribution. My null and alternative hypotheses are: $H_0=p=0.5$ and $H_1=p1=p>0.5$ After some work I obtained a ...
0
votes
0answers
4 views

Finding location of maximum D-statistic from KS test [migrated]

I'm comparing two different empirical cumulative distribution functions using the KS-test, and I'd like to extract the location (in the ECDF) where the maximum of the test statistic is. Question: ...
0
votes
0answers
20 views

Kriging results are too localized, how can I increase the influence of each data point

I have a small dataset that looks like this... ...
1
vote
2answers
171 views

How to interpret standardized regression coefficients and p-values in multiple regression?

I've been using R to analyze my data (as shown in example below) and lm.beta from the QuantPsyc package to get the standardized ...
0
votes
2answers
31 views

categorical predictors in a GLM

I need some help answering a homework question, Question I have entered the data into R using assignments ...
0
votes
2answers
39 views

R² of 1 with dynlm procedure?

Dear statisticians/programmers, I want to model the price of AXE deoderands in Albert Heijn (a dutch supermarket) as a linear function of its own past (up to two lags) and the past of the price of ...
2
votes
1answer
40 views

Defining NULL group for dummy variables

I am quite new in R and am on a stage of running a regression model there. The approach we have chosen is linear regression with dummy variables. As far as my knowledge and experience go when using ...
0
votes
0answers
37 views

R: Package “PMA” the function CCA

I would like to understand the output of the function CCA (so sparse CCA) in the package PMA. The following code is an example of the package itself, but I would like to interpret it. ...
0
votes
0answers
29 views

Middle point between k-means and DBSCAN in R

I have a big data sample of unrelated events in lon,lat,date format (booking locations to dispatch). I am trying to divide these events into clusters (k=50) where I ...
2
votes
0answers
37 views

Linear mixed effects model methodology suggestions

4 beehives were equipped with sensors that collected temp, humidity, pressure, decibels inside the hive. these are the response variables. the treatment was wifi exposure, the experimental groups ...
-1
votes
1answer
23 views

Why is this matrix code not behaving? [closed]

I'm running this code: ...
0
votes
0answers
12 views

R: how to cluster data by EM algorithm and get Mahalanobis distance?

I have some data, the format as follows: ...
0
votes
1answer
46 views

How to OLS Regress Y on 1/x denominator in R or Python

I have a problem where my general equation is $Y = C + 1/(\beta x)$, where $C$ is a constant. I want to find a b in OLS fashion to minimize RSS I have already transformed my equation thus far: $Y - ...
1
vote
0answers
55 views

R forecast from STL

I want to understand how forecast from STL function in R works. So, I am not giving any reproducible code here. Below is the procedure that I worked on time series I used STL decomposition on my ...
0
votes
0answers
22 views

Forecasting sales for multiple departments using external factors

I have got the weekly sales information for various locations for about 3 years.It has got information for 157 weeks.Also,I have got the probable external factors affecting the sales.I want to ...
0
votes
0answers
11 views

Generate sample of data in R [migrated]

I trying to learn how to use R for statistics and I would like to how can I can I generate 20 000 (K number of pairs) times a set of two samples each with 50 points from the same normal ...
1
vote
1answer
108 views

I would like to analyze the data using R and Python. How to handle 10 millions records of data? [closed]

I would like to analyze the data using R and Python, and I am unable to open text file due to huge number of records. Is there any free database software to install in PC and load the data into it and ...
0
votes
0answers
11 views

With a huge table(with 300K rows and 20+ columns) to use gglasso in R [migrated]

I'm using R to analyze the data with huge dataset, which have 300K+ rows and 20+ columns. All columns without the column with dependent variable are categorical. Function specification shows that the ...
1
vote
0answers
7 views

tuneRF and stepFactor problems

down vote favorite I feel uncomfortable with the meaning of stepFactor parameter of tuneRF function which is used for tuning the mtry parameter used futher in randomforest function (R program). The ...
1
vote
1answer
92 views

How to understand this ACF

I have two time series. After calculating the ACF, they are like the plot below. Does anyone know the meaning of this ACF plot? I know it's non-stationary time series, but I don't know how the ...
2
votes
1answer
102 views

glm.fit: algorithm did not converge -Tweedie

I'm trying to estimate $p$ in tweedie regression, but I got the following message: glm.fit: algorithm did not converge I'm using public data from "GLMs for insurance data" book by Piet de ...
0
votes
0answers
5 views

Is there any R programs can get the Row and Column space of a matrix? [migrated]

In R, there is a method Null which can get the null space of a matrix. But, is there any R code can get the row and column space of a matrix ?
0
votes
0answers
6 views

Creating a normalized histogram of log intensities with GEO datasets [migrated]

I'm trying to create a density/log intensity histogram of a normalized GEO microarray dataset. I have tried doing this several different ways, but unfortunately I have had little to no luck. What is ...
4
votes
0answers
36 views

Creating Package Documentation with RStudio? [migrated]

I managed to create a package using RStudio and roxygen2. The whole package-creating process worked without any errors and warnings. Anyway, my question is how do I create a PDF documentation of my ...
0
votes
0answers
19 views

R-Multicollinearity in panel data

A similar question has come up before: Test for Multicollinearity in Panel Data R I am using the plm package and the within estimator on an unbalanced panel for a project and want to check for ...
1
vote
1answer
67 views

generate a time series comprising seasonal, trend and remainder components in R

I want to generate a time series comprising three components: a seasonal component, a trend component and a remainder component. Moreover, I want to be able to chnage the level of trend, seasonality ...
1
vote
0answers
15 views

How to analyze time in R [migrated]

For several months I have noted down the time that I woke up each morning. What I have now is a database that contains times of day in 24 hour format, e.g. ...
4
votes
3answers
66 views

forecast using arima models

I am trying to predict values using arima(0,1,1). After doing predict(mod,n.ahead=5) (in R) am getting the same value for all ...
0
votes
0answers
21 views

calculate the hat matrix for logistic regression in R

For This Model How To Calculate hj and bj with R.
0
votes
0answers
4 views

gwidgets tbl to dataframe [migrated]

From Combo box I have inserted a few values to a Table in gWidgets GUI. I just wanted to know how to take the content of this table as an input to a data frame. I tried ...
2
votes
1answer
35 views

Residuals perfectly symmetric about zero against fitted values

Consider a modelling a response $Y$ against two categorical variables (which can take $4\times 2=8$ possible combinations). We have 16 values for the response, with two values for every combination of ...
2
votes
1answer
20 views

Which distribution should I use when building a GAM in R?

What type of distribution would you consider this data to be? My first thought is an f-distribution, but I suppose it could also be a poisson distribution. I am trying to build a generalized additive ...
1
vote
1answer
61 views

Linear model trace of the hat matrix in R

This question is about the difference between the sum of lm.influence(model)$hat and the trace of the Hat-Matrix $H := X (X' X)^{-1} X'$ calculated "by hand". ...
1
vote
0answers
22 views

R lmer Model Diagnosis qqnorm

I fitted this lmer model: m1 <- lmer(logR ~ N_g.m.2 * Year + (1|Wh/N_g.m.2), data = CO2_Ratio) Rendering the attached qqplot. ...
2
votes
0answers
24 views

QQ plot for log-logistic and 2 parameter exponential in r

Is there any package in R, which help us to plot QQ plot for log logistic distribution and 2 parameter exponential distribution? What methodology can be adopted for the same?
0
votes
1answer
24 views

Outer crossvalidation cycle in caret package (R)?

Could somebody provide a nice example code how to best implement an outer crossvalidation cycle using the caret package in R? The package provides a convenient trainControl() argument to ajust the ...
0
votes
0answers
23 views
0
votes
2answers
75 views

Hypothesis testing using R

...
0
votes
0answers
14 views

How to write and read matrix from file without column names? [migrated]

A matrix Aexample is: ...
0
votes
0answers
22 views

How to find the critical value for a test using R [closed]

I am trying to construct a hypothesis test using R. I want a significant level of about 0.05. How can I find the critical value that I would you choose ? I know that I can use pbinom in order to ...
-1
votes
1answer
19 views

Does polr require all dependent factors to be numeric

This is my first try at any regression and unfortunately I'm starting with an ordered logit model using the polr function in R. Does ...
0
votes
0answers
8 views

Comparing Learning Rates using Unit Curve in R

I have data for an experiment where 2 groups (Role) were tested over 3 consecutive trials for a task and time to complete task was recorded in sec. I wanted to compare the learning curves of the two ...
0
votes
0answers
17 views

Choosing a Model for Inference

I'm trying to understand what factors contribute to the a certain outcome which is a ordered factor variable. In order to just understand which factor is statistically more significant than the ...
7
votes
2answers
178 views

How can you test homogeneity of variance of two groups with different sample sizes?

I have two groups of data that have different sample sizes and in order to be able to analyze both sets they must have the same variance. I was told I should use Bartlett's to test the homogeneity of ...
1
vote
0answers
23 views

approaches for computing confidence band and prediction band for general regression analysis and predictive models

In linear regression model, the predict in R is able to calculate the confidence band and ...
0
votes
0answers
17 views

Pooled likelihood in R, how to code it? [migrated]

I don't really know how to construct the following likelihood in R. I have panel data for several individuals. Each individual is observed over time and I have several observations for each ...
0
votes
1answer
43 views

Post Hoc test after lme [closed]

I am trying to run a Post Hoc test (glht) after a linear mixed model (lme) in R. I was ...
0
votes
0answers
22 views

quadratic endogenous variables in R

As part of ongoing research I'm to test a certain model on some data. One of the questions asked (c.f. one of the hypotheses) involves estimating the quadratic term of an independent variable (in R). ...