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
0answers
7 views

How to get the overall effect for linear mixed model in lme4 in r?

I would like to get the significant value and effect size of the independent variable in overall, rather than the normal output from lme4 in R. It is just like the thing people report when running ...
0
votes
0answers
10 views
0
votes
0answers
7 views

Discriminant analyses with NIRS in R

I am working with a NIR matrix consistent of 134 rows (samples) and 1529 columns (wavelengths), from which I want to discriminate between two categories (species). I have successfully used the plsda ...
0
votes
0answers
12 views

Should I be using a GLMM?

I'm looking at the influence of pollen type on whether a flower sets fruit (i.e., yes or no = 1 or 0). Then looking at number of seeds per fruit (1-6 possible). I was told I should use lmer, however ...
0
votes
0answers
10 views

Linear model in R - 2 fixed and one random factor

I have performed an experiment on plants and have some trouble analysing the data. For the experiment, we have three replicates (in time), two species and three treatments. In each experiment, we ...
0
votes
0answers
29 views

Is the distribution of my residuals from a multiple regression normal?

I have a dataset with 17 variables (one numerical, 16 categorical). The numerical variable is the execution time of a process. I'm using one of the categorical variables (100 levels) to predict the ...
0
votes
0answers
6 views

LMG don't sum to model's R2

I have a regression model and I want to determine the relative importance of the predictors. I used the package relaimpo in r. The package says that 98.84% of the ...
0
votes
2answers
24 views

AB testing with R [on hold]

I'm new with AB testing and i want to do this with R (free and easy to learn software). Can anyone help with sample code in R for AB testing? Thanks Ariel
0
votes
0answers
8 views

R quantmod candlesticks do not plot; OHLC data seems unrecognized [migrated]

I am following a basic tutorial for R's quantmod package. I run into trouble using the candlestick plots however. It appears that ...
0
votes
0answers
11 views

Are there any packages in R to use Apache Shark?

I would like to data mine Apache Shark with R but I'm not sure if there any packages available for R. Does anyone know of any? Thanks
0
votes
0answers
1 views

Using R-Studio for data mining to compare different data sets against one another, asynchronously

For a project, I've collected some basic information on weather, and some basic information on births. Both data sets are focused on a single state, Massachusetts. The weather set contains very ...
0
votes
1answer
9 views

maximizing frequency

I am trying to find the area with thickest density. I have newborn numbers by day for which I am trying to find the series of 7 consecutive days that would produce the highest frequency. So the start ...
2
votes
0answers
15 views

Inspecting mechanism for missing values in categorical data without prior knowledge

Scenario I am inspecting the Soybean data set, which has a quite a number of missing values for various categorical variables. Plan My plan is to eventually perform data imputation. However, ...
0
votes
0answers
15 views

how we get Initial starting value in goodness of fit in R [on hold]

How we chose starting initial value in R to estimate the parameter by goodness of fit or MLE
1
vote
0answers
21 views

Hyper-prior for negative binomial in hierarchical model using JAGS/BUGS

Below I'm using a negative binomial because it is more flexible than a simple poisson model. The data are counts $y$ of events for 16 individuals $x$. There are 14 counts (i.e. counting periods) for ...
1
vote
1answer
27 views

P value for interaction term in mixed effects models using lme4

I'm analysing some behavioural data using lme4 in R, mostly following Bodo Winter's excellent tutorials, but I don't understand ...
1
vote
0answers
30 views

Repeated measures mixed model using lmer in R

I’m hoping to get some guidance in specifying a mixed model using the lme4 package in R. The study is quite straightforward. It’s a repeated measures design with pre/post measurements on the ...
1
vote
1answer
26 views

Variance-covariance matrix of survival model

Suppose I have a survival model like this: ...
0
votes
0answers
24 views

what is the return value of predict in the fGarch package

I have a question about a quit sophisticated model for a time series. Suppose $ \{X_t:0\le t\le T\}$ is a time series. The plot of autocorrelation function and partialcorrelation function suggest and ...
0
votes
0answers
8 views

Error message when fitting 3-dimensional Copula [migrated]

I want to use a Gumbel Copula for a 3-dimensional data set. I use R and the Copula package. It gives me an error, though. This ...
1
vote
1answer
37 views

Compare two samples

similar questions have been asked but have not managed to get a conclusion from them. I am comparing two sets of samples, where ratios have been obtained for several analytes per sample. So the values ...
1
vote
0answers
9 views

Optimum value of minlev in function combine.levels

I have a dataset of 306967 rows and 23 columns, and I am building a regression model for predicting a factor based upon 6 other iid variables. Doing this I encountered an issue of large no of levels ...
1
vote
0answers
14 views

Problem with visualising logistic regression using the effects package in R [migrated]

I am using the effects package in R to plot the effects of categorical and numerical predictors in a binomial logistic regression estimated using the lme4 package. My dependent variable is the ...
0
votes
0answers
6 views

Balanced sampling in R [migrated]

Currently I'm using "cube" function for balanced sampling in R. It works fine on moderate amount of data. However, if the entire population of 10,000,000+ is used, R hangs. Is there any alternative ...
0
votes
0answers
17 views

Simulating a bimodal biased IV estimator

How can I simulate a bimodal biased IV estimator? The common unimodal heavy-tailed biased estimator would be something like this: ...
0
votes
0answers
24 views

Hidden Markov Models methods for selecting optimal number of states

Package RHmm (R) I have a vector which I fit into a hmm model in an attempt to select an optimal number of states for a hidden markov model. ...
0
votes
1answer
30 views

Estimating finite sample bias for Instrumental Variables

Are there ways to estimate the finite sample bias with instrumental variables? I guess this would be conditional on assuming some structure to the problem and also would involve simulation, but, at ...
6
votes
0answers
31 views

Multivariant time series in R. How to find lagged correlation and build model for forecasting

I'm new in the page and pretty new in statistics and R. I'm working on a project for college with the objective of finding the correlation between rain and water flow level in rivers. Once the ...
2
votes
1answer
57 views

Plot graph with more than one value on x and y-axis in R

I have a dataset containing two columns and a total of 90 rows. The data is from my experiment where in the first column I have an integer representing the quantity, in the second column I have a ...
1
vote
0answers
22 views

How to predict cumulative hazard in survival analysis?

Suppose I have a survival model like this: ...
0
votes
0answers
16 views

Cochran-Armitage test for trend in R

I have a 4x2 table that I want to do a Cochran-Armitage trend test for. Basically, I want to test for lack of independence as the dose (the rows) increase. I'm trying to figure out the R code but am ...
0
votes
0answers
10 views

Degrees of freedom correction to pooled regression of demeaned data in R

Is there a canonical way to do degrees of freedom (DF) correction to ols objects from the rms package (and to ...
1
vote
3answers
97 views

Sampling data to have specific mean and standard deviation

I have a data that I want to sample such the resultant distribution of values should have specified mean and standard deviation. I can think of rejection sampling to achieve this however that seems to ...
0
votes
0answers
10 views

Probabilities of predicted classes for a bayesnet using bnlearn R package [on hold]

I have been trying to use a Bayesian network to predict a target node. I want to find the probabilities of each class instead of the class labels when I use the corresponding predict method. I am ...
0
votes
3answers
48 views

Problem with PCA

I am trying to do some PC analysis on my data coming from lipids measurements in different samples. I only have one factor: if samples are diabetic or non-dibetic. Here is the PCA graph I get: As ...
0
votes
1answer
36 views

Power transformation using Box-Cox transformation

I have a dependent variable Cost and an independent variable VPT. I want to perform a power transformation on ...
0
votes
0answers
65 views

Data Visualization with R, not possible by excel 2007 [on hold]

Can you please suggest me some good data visualizations using R which are very tedious to do using Excel 2007? For example, I found treemap in R which I can't able ...
3
votes
1answer
212 views

Newton's algorithm for a Minimax Procedure

In order to find the minimax solution of a certain problem I have to determine the constant $c$ that provides the root for the following equation: $$l(c)=3\times \left [ 1-\Phi \left( c-75 \right) ...
0
votes
0answers
8 views

Minimum Distance Estimator in r

I am running a regression to estimate the relationship between a dependent variable and some regressors. Let's say I have two alternative models based on two different assumptions about the exogeneity ...
0
votes
0answers
30 views

avoid for loop in R [migrated]

I am basic level in R. It's said better to rewrite loops by apply. But for the following problem, I've no idea how to achieve that. Can anyone help? Or recommend some similar examples? ...
2
votes
1answer
35 views

What exactly does the 'boxcox' function in R do?

I am familiar with the power transform family and I know how to estimate the MLE for $\lambda$ for given samples of a random variable. I have been using the 'boxcox' function in R for a sample of a ...
0
votes
1answer
41 views

What do the coefficients of the crossproduct of regression mean?

How can I interpret the coefficients of the crossproduct of each of the following codes? What do they mean? How can I deduce that they correspond to our expectation? ...
0
votes
0answers
14 views

Using a Decision Tree Algorithm such as C4.5 to understand population Partition

I have multivariate data about a certain population with more than 1000 attributes per exemplar. Some of the variables are basic demographics attributes including: gender, age, race, ethnicity, ...
3
votes
2answers
103 views

Efficiency of beta estimates with heteroscedasticity

I need something clarified and that is when you have non-constant variance, estimates won't be biased but will be a problem when it comes to the S.E. formulas and efficiency. Therefore OLS estimates ...
1
vote
0answers
38 views

Stata's xtlogit (fe, re) equivalent in R?

Stata allows for fixed effects and random effects specification of the logistic regression through the xtlogit fe and xtlogit re ...
0
votes
0answers
3 views

Plotting the overlay using an exponential smoothing of a time-series using `lines()` [migrated]

I have the following code so far but I am not sure which function I should use for plotting the yearly average measurements of temperature for New Hampshire, from 1912 to 1971, and overlay an ...
2
votes
2answers
125 views

Difference between regression methods

I have a set of data where the response is a proportion. For each event in the experiment, a system will correctly tag X of Y ...
0
votes
0answers
8 views

How to insert output into command line / function [migrated]

I have output ("1b" "2b" "3b" ... "40b") The values are then inserted into a function for further calculations. I am prepping the values with the following code. ...
0
votes
0answers
15 views

Model matrix of a mixed model

Suppose I have a mixed model like this: ...