instruction
stringlengths
9
38.7k
Is there a way in R (a built-in function) to calculate the transition matrix for a Markov Chain from a set of observations? For example, taking a data set like the following and calculate the first order transition matrix? dat<-data.frame(replicate(20,sample(c("A", "B", "C","D"), size = 100, replace=TRUE)))
I heard Kernel Logistic Regression is a classical combination of kernel methods and Logistic regression, but I cannot find any major reference (book, or paper) on this topic. Can you give me any suggestions? Thanks.
I am trying to decide on the correct technique for a multivariate regression with spatial data. I would like to run a regression where the dependent variable is the current snow depth and the independent variables include physiographic parameters (slope, aspect, elevation, etc.) and snow depth for the same site in past...
I have a program generating purportedly normal distributions and I would like to test it. I have a number of issues; perhaps the experts here will help me sort out the essential from the inessential and answer most of these. I'm looking for a simple test, ideally -- one I can implement without too much trouble. There...
Can somebody help me to understand a topic? Say in my analysis I have the true variable education ($E$) which is measured by a proxy variable number of years in school ($S$). Here, the error is measurement is $E-S$. I was told that, this error is independent of $S$ not of $E$. I can not understand how it can be the cas...
Regarding multiple comparisons, could someone please explain me why the power of false discovery rate (FDR) is greater than the power of family-wise error rate (FWER)?
Following Brian Diggs's answer, I have tried to estimate some survival probability in R. However, the result is wrong (1 instead of 0.9) and I do not understand what is going on... Can you explain me? > time [1] 1.38103330 2.14191380 1.47271212 0.02703924 0.34921793 3.01005383 1.01132532 0.09546903 0.44729971 1.129095...
Consider the following mixed model: $$(y_{ijk} \mid \mu_{ij}) \sim_{\text{i.i.d}} {\cal N}(\mu_{ij}, \sigma^2), \quad k=1, \ldots K $$ $$ \begin{pmatrix} \mu_{i1} \\ \vdots \\ \mu_{iJ} \end{pmatrix} \sim_{\text{i.i.d}} {\cal N}\left(\begin{pmatrix} \mu_{1} \\ \vdots \\ \mu_{J} \end{pmatrix}, \Sigma\right), \quad i=1, \...
Disclosure: I'm preparing my oral exam for statistics (so I'm tagging as homework, hope it's appropriate). I think that I'm failing to understand the concept of power of a test (under a graphical point of view). I'll try to explain what I have in mind: I have a test for which I have H0: Mu = 52 H1: Mu > 52 Confidence: ...
Suppose a number of random variables (call them "errors") observed for different "scores". For every score 11 errors have been observed. See the plot below to get the picture: I would like to know in what scores the error is "big". For this, I think a good approach would be to test the hypothesis $\text{H}_0: \overlin...
I'm analysing reaction time data from a grammaticality judgement task (collected in a masked-priming experiment). The stimulus were noun-noun compounds, including 3 types of compounds (depending on semantic relation). Each compound was tested 4 times, in a 2x2 design (prime = N1 or N2; order = grammatical or ungramma...
I'm reviewing a paper which has the following biological experiment. A device is used to expose cells to varying amounts of fluid shear stress. As greater shear stress is applied to the cells, more of them start to detach from the substrate. At each level of shear stress, they count the cells that remain attached, and ...
Some predictive modeling techniques are more designed for handling continuous predictors, while others are better for handling categorical or discrete variables. Of course there exist techniques to transform one type to another (discretization, dummy variables, etc.). However, are there any predictive modeling techni...
I have random sets of $N$ random 32-bit strings, where all bits are i.i.d. with $\mathbb{P}(0) = \mathbb{P}(1) = 1/2$. Define $\ \ \ \ $weight( 32-bit x ) = number of 1 bits in x, i.e. Hamming distance to 0 $\ \ \ \ $minweight( set $X$ ) = min$_{\text{x} \in X}$ weight( x ) How does the average minweight( $X$ ) vary wi...
I'm attempting to perform hierarchical agglomerative cluster analysis in R. However, when I use particular clustering methods, I get reversals (upward branching) in the resulting tree, which violates the ultrametric property. The two methods are: UPGMC and WPGMC (methods="median" and "centroid" in hclust). Legendre ...
I have this question: It is reported that 45% of the population prefer apples and 55% prefer oranges. Describe the methodology for conducting the survey. I am not sure if my reasoning is correct: Assuming the population prefers either apples or oranges (not both nor neither) Do a sample of the population, assign a...
I'm using the survival package in R to analyze clinical data. I am analyzing two different groups of patients, when I calculate survdiff in order to compare the curves, I got p= 0.135, but when I adjust the model using coxph and different covariates, let say clinical cancer stages, , I got an overall logrank score of 0...
I'm trying to understand an algorithm that detects similar regions of an image using PCA. The algorithm essentially divides the image into overlapping square blocks and then does PCA with each block as a dimension. Next it does a lexicographical sort of the principal components to arrange similar blocks close to one an...
I'm working on a securities pricing project and have a bunch of models I'd like to stack/ensemble together. I've been using simple linear regression in R (the lm() function) so far but the results are over fitting pretty badly. Does anyone have any suggestions for whether some other stacking method might be better o...
SVM using RBF kernel is claimed to be similar (equivalent) to the K nearest neighbor classification method. I am not very clear about the analysis process of building this kind of relationship. Thanks for explanations.
I am familiar with the idea of metrics in software and I know something about using distance functions in clustering, but I don't really know what is meant by "formal distance metric". What is the difference between a distance function and a formal distance metric?
I have small datasets of size 40-50 points. Without assuming that the data is normally distributed I wanted to find out the outliers with 90% confidence at least. I thought boxplot could be a good way to do that but I am not sure. Any help appreciated. Also with boxplot implementations I could not find a implementation...
I am using the mlogit R package. For a subset of my dataset, mlogit is learned ok. For another subset of my dataset, I get this error. Error in solve.default(H, g[!fixed]) : system is computationally singular: reciprocal condition number = 1.12239e-16 When I looked for this error in contexts outside of mlogit, one su...
It is almost a permanent need in researching progress addressing/referring the first inventor, proposer or developer of the concepts which are widely being used these days. Have got no clear idea how to manage these needs but relying on the personal knowledge and sometime Wiki helps. But this does not work all the time...
I have a sample that is pretty normally distributed with a mean greater 0. Is there any way to get a closed form estimate for the mean of all values that are less than 0? In other words, given a mean, variance and a variable x, can I estimate the average of all values that are smaller than x?
My data is 1,785,000 records with 271 features. I'm trying to reduce number of features used to build the model. Q1. while exploring the data I found that some features are almost all missing data, like only 25 records has value for this feature and the others records has missing values, so I thought that is not inform...
I ran a simple psychology experiment that included 4 conditions, each containing 8 blocks of training. There were different participants in each condition. Hence, condition and block and subject and block are crossed, but subject is nested in condition. I'm trying to do a basic repeated measures anova to test for effec...
Suppose $X_1,\ldots,X_n$ are a random sample of a continuous and strictly increasing distribution $F(x)$ with mean $\mu$. If $$ Y_i = \begin {cases} 2 & \text{if}\ X_i>\mu \\ 1 & \text{if} \ X_i\leq\mu \end {cases} $$ Determine the MLE of parameter $\mu$
I understand that variance can be zero if all data points are equal. Can anybody state an example, where sample variance is equal to sample mean and what - if any - is its significance to distributions like the Poisson.
In “A Comparative Study of Nursing Home Residents …”, Aigner et al. write (p. 20) Acute visits were significantly higher for the nurse practiticoner/physician team at 3.0 visits per year (± 2.4) versus 1.2 visits per year (± 1.5) for the physician-only group (P <0.0001) Furthermore, (p. 19) The statistical analysis ...
I recently saw a paper that presented the results of a multiple regression, and then proceeded to also present the results from univariate regressions for the independent variables in which they were most interested. The multiple regression already showed 4 significant independent variables (interactions were not consi...
It's multivariate linear regression meaning multiple dependent variables (Y). Data A has both X (explanatory variables) and Y, but data B has only Y. I wonder if there is any way to incorporate data A and B into the regression model. If I remember correctly, Statistical Analysis with Missing Data by Little et al, sugg...
I'm writing a CFA paper, and I have run into some trouble interpreting the AIC and BIC. This is my first paper using continuous variables, thus the first time I will be reporting these fit statistics and I'm still learning the SEM method overall so bear with me, please. The paper in question looks at an existing psycho...
Under-educated non-statistician seeks short-term relationship for very one-sided benefit. System in question involves rocks and physical properties. Modelling bits of the earth typically means few real measurements compared to volume of model. Many estimates are required, and I have NO IDEA how to handle the statement ...
Still on running logistic regression models and would like to ask a few questions around it. Question 1: Is there a simple way of getting the p-values of each independent factor in a logistic regression model. For example, I am running this model: mymod3 <- as.formula(surv~as.factor(tdate)+as.factor(sline)+as.factor(pg...
At many question-and-answer sites, like StackExchange, people can upvote or downvote each answer. These sites also typically try to use the votes to sort answers, so the answers that are most likely to be helpful or accurate tend to appear nearest the top. Given the number of upvotes and downvotes for each answer, ho...
I am doing my research on Personality (the big five factors) and if personality can predict commitment to an organization. However, commitment is composed of three dimensions. What is the best method I can use when trying to link the big five factors of personality with commitment to an organization?
I have been comparing tails of various distributions for an application where we will need the conditional expectation of the tail or a truncated tail: $E(X | a<X \leq b )= \frac{\int_a^b x f(x) dx}{F(b) - F(a)}$ There is some limited information out there on the web [such as http://en.wikipedia.org/wiki/Truncated_no...
I recently switched to SPSS v20. Now when I export graphs to a DOC file the graphs are images. When I export from my earlier version of SPSS the graphs can be edited. Can anyone tell me how to export editable graphs with V20? Thanks!
I am wondering if there are standard naming conventions in general for confidence distributions or for the particular cases of the non-centrality parameters of (non-central) $t$- and $F$-distributions. For the unitiated, let random variable $X$ have CDF $F(x;\theta)$. The confidence distribution CDF for $\theta$ is ju...
Consider the following graph: The red line (left axis) describes the trading volume of a certain stock. The blue line (right axis) describes the twitter message volume for that stock. For instance, on May 9 (05-09) about 1.100 million trades and 4.000 tweets were made. I would like to calculate whether there is a corr...
This may be both a stats and economics question. Let's say that I am bidding in an auction for emails. There are 10,000 + plus emails and there are five bidders and each of us bids on a SINGLE email throughout the day as they become open to bids. The highest bidder wins the auction. Our revenue comes from us turning ar...
I am doing a cluster analysis based on k-th-nearest-neighbor (KNN) method in SAS. The CLUSTER procedure requires to specify the $k$ (=number of neighbors to use for KNN density estimation) and I was wondering if there is a way or criteria to set the number of neighbors. Based on the SAS manual, k th-nearest-neighbor d...
As the general consensus seems to be to use mixed-models via lmer() in R instead of classical ANOVA (for the often cited reasons, like unbalanced designs, crossed random effects etc.), I would like to give it a try with my data. However I am worried that I would be able to "sell" this approach to my supervisor (who is ...
How do I generate numbers based on an arbitrary discrete distribution? For example, I have a set of numbers that I want to generate. Say they are labelled from 1-3 as follows. 1: 4%, 2: 50%, 3: 46% Basically, the percentages are probabilities that they will appear in the output from the random number generator. I have ...
I have a longitudinal (panel) dataset for investment growth for 120 countries covering the time from 1960-2008. Essentially it's viewed as 120 time series. What I am interested in is to group countries based on their shape of their growth curves over time. Thus whether they share similar Shape of their curves are the...
I have been using the Root Mean Squared Error (RMSE) to measure the accuracy of values predicted using a model. I understand that the value returned is using the units of my measures (rather than a percentage). However, I would like to quote my values as a percentage. The approach that I have taken is to normalize the ...
I am a software engineer and I have been asked to look at some performance issues that we are having with some batch-jobs on a system I am working on. The batch jobs generate data for different categories (A-Z), however the mix of categories varies depending on the time of day. The job is run 5 times a day. The total a...
I am wondering whether SVM based recursive feature elimination (Guyon et al., 2000) would be considered a filter or a wrapper method. On the one hand, it "wraps" around an SVM to get the lowest-weight features. On the other hand, the trained model is never applied to any test set. What do you think?
I have some time-series data that I wish to test to see if a certain factor has an effect. There are few samples per time step (10 on average), but the whole time-series has 306 samples. When divided into groups based upon a factor the result is non-normal and non homogeneous. I wish to test the effect of the factor, a...
Suppose $X_1,X_2,\ldots,X_{2n}$ is a random sample of $N(0,1)$. If $D_n=\displaystyle\sum_{i=1}^n X_{i}^2$ and $R_n=\displaystyle\sum_{i=1}^n \frac{X_{2i-1}}{X_{2i}}$ and $T_n=\displaystyle\frac{R_n}{D_n}$, what is the limit distribution of $T_n$?
I have a data set which displays a bimodal distribution. This was determined by plotting a histogram of the frequency vs number. I now need to separate the two original populations and therefore find an intersection point of sorts. From the plot it looks like the point might be approx. -1.0 to -0.8. Is there a straigh...
I would like to compare AUCs for two treatments using the boot package in R. However, something wrong with my R code and I don't know how to fix it. Can someone please give me a hint? many thanks in advance require(boot) #Create Data set.seed(123) N = 150 y1 = rnorm(150) y2 = rnorm(150,1,0.2) y3 = rnorm(150,2,0.5) time...
I have one question about this. I know that if we have $\mathrm{X}_1,\mathrm{X}_2,\ldots,\mathrm{X}_n$ independent and normally distributed random variables, then the sum $\mathrm{X}_1+\mathrm{X}_2+\ldots+\mathrm{X}_n$ has the normal distribution with mean $M_1+M_2+..+M_n$ and variance $\sigma^2_1 + \ldots + \sigma^2_...
I'm working on a questionnaire that is intended to measure two constructs. There are presently 26 items in the questionnaire -- eleven for construct 1 and 15 for construct 2 -- and each item has five available responses: "strongly disagree" "disagree" "neutral" "agree" "strongly agree". In our first iteration of the q...
I have an assignment that asks me to explore different series of data with respect to the effects that an incinerator built in 1981 in Massachusetts, has on the price of houses in that area. I have around 30 different sets of data with regards to the houses ranging from 'number of bathrooms', 'distance from the inciner...
The following lines are taken from a lecture found here. I have a very small question regarding this explanation of Poisson likelihood. The Poisson likelihood can be used any time your data come in discrete intervals (which we'll call “counts”), and the counts are independent of each other. Schematically, we imagine di...
It is well accepted that one should account for model complexity when performing model comparisons, and the general procedure is to penalize more complex models more strongly. While this makes sense when the parameters of a given model are easily estimated (i.e. analytically, as with the mean, variance, etc), it occurs...
As part of the network analysis, I plotted a Complementary Cumulative Distribution Function (CCDF) of network degrees. What I found was that, unlike conventional network distributions (e.g. WWW), the distribution is best fitted by a lognormal distribution. I did try to fit it against a power law and using Clauset et al...
I am looking at some data with a 5 factors and a response variable. The experiment was designed as a factorial experiment, with observations at different levels of each factor. One thing that I have notices, though, is that there is some variability in the readings for the factor levels. For example, motor RPM is a var...
If I have two players that are about to engage in a head to head competition, how do I simulate a winner based only on win percentage? One idea I had was to create a "weighted winning pool" where I add the two percentages and then randomly pick a number in that pool. If it's in the percentage range of a team then that ...
I computed a simple linear regression model from my experiment measures in order to make predictions. I have read that you should not calculate predictions for points that depart too far from the available data. However, I could not find any guidance to help me know how far I can extrapolate. For example, if I calculat...
I'm trying to find the variance of $L$, $Var(L)$, using the delta method (I want to find a closed form). $L$ is defined as: $$L = \frac{A}{B} + \frac{C}{D}$$ All $A$, $B$, $C$, and $D$ are dependent. But I'm not sure how to proceed.
I am asked to give a lecture on clustering algorithms for an audience that is not very technical. With that in mind, I wanted to do a simple exercise where I will ask the audience to identify groups from a dataset. However, I cannot find good datasets that could be usable for this purpose. Is there a dataset of custome...
In my study, I have one group encoding 2 different types of words (within subjects) and 3 different dependent measures namely recall, recognition, rating. I think that I can conduct repeated measure analysis. But I am confused about what should I write for factor name. I think I have one factor with two levels because...
I've downloaded a script to draw a correlation matrix using colored circles. This script allows to order variables using PCA, but I'm not sure how it works. The code responsible for ordering is below: if (order) { if(!n==m){ stop("The matrix must be squre if order is TRUE!") } x.eigen <- eigen(c...
Let $X_1,X_2$,....,be a random sample from $N(q,w^2)$; $q,w$ are unknown. Let $S_n$ be the sample standard deviation. i.e $S_n^2=\frac{1}{n-1}\sum(X_i-\bar{X})^2$ What is $Var(S_n^2)$? and how to show that $S_n^2$ is asymptotically normal? I tried to do Variance part using moment generating functions but expressions a...
Asked already on stackexchange, this place is probably a better fit, if somebody could delete the old post I'd appreciate it. I have a linear regression equation from school , which gives a value between 1 and -1 indicative of whether or not a set of data points are close enough to a linear function and the equation...
I had some problems fitting an ARIMA - the data are FTSE <-log(EuStockMarkets[,"FTSE"]) The following link explains the problem and gives the solution http://www.stat.pitt.edu/stoffer/tsa3/Rissues.htm#Issue2 The solution sounded effective, untill I tried some $ARIMA(p,d,q)$ other than $ARIMA(1,1,0)$: with $ARIMA(1,...
I have two sets of data from the FRED database: real GDP (y) and GDP deflator (p) and I want to be able to use R in order to estimate a VAR(p) (p determined by AIC) process and generate the sets of impulse-response functions with the short-run assumptions (Sims, 1980) which utilizes the Cholesky decomposition. Since th...
Are there any particular assumptions regarding the errors for logistic regression such as the constant variance of the error terms and the normality of the residuals? Also typically when you have points that have a Cook's distance larger than 4/n, do you remove them? If you do remove them, how can you tell if the mode...
Suppose I have $\sigma|Y,Y*,\psi$~$Inverse-Gamma(A, B)$. How should I get $\sigma^2$. Can I just square the result from Inverse-Gamma? To me, this seem to work, if you think of it this way: $\sigma$ is the standard deivation and $\sigma^2$ is the variance, and this relationship is one-to-one. You are just squarin...
I'm comparing plausible models selected a-priori to predict a binary response variable. I used binary logistic regression in SPSS20 and obtained AIC=-2*LogLikelihood+2k where k is the number of parameters in the model. Using the GLM procedure (binary logistic) I get provided with AIC, AICc, BIC etc. straight away, howe...
Possible Duplicate: Validation techniques for hierarchical model I already posted this to Math.SE, but I realized this would probably be a better place to post to. I have a hierarchical model that I need to validate. My model is as follows: we have a collection of $λ_i$ that we draw from ${\rm Gamma}(α,β)$. Then, ...
I have spent a fair amount of time trying to solve this problem but I can't find the solution. More specifically, I have the following matrix: P(D|E&F) = [ 0.5 0.3 0.5 0.2 ; 0.5 0.7 0.5 0.8 ] All the variables are binary (two states) D, E and F are nodes of a Bayesian network. E and F are the parents of ...
Assume I have two factors A and B potentially predicting my outcome Y. Now I would like to test for fixed-effects using likelihood ratio test to find the best model. fm1 <- lmer(Y~1+A*B+(1|subject)) fm2 <- lmer(Y~1+A+B+(1|subject)) fm3 <- lmer(Y~1+A+(1|subject)) fm4 <- lmer(Y~1+B+(1|subject)) fm5 <- lmer(Y~1+(1|subject...
I've been using a Metropolis/Gibbs sampler combination to generate a joint density for some parameters(it is a hierarchical model, with $y_i\sim Poisson(\lambda_i)$, $\lambda_i\sim Gamma(\alpha,\beta)$). What techniques can I use to lower autocorrelation(it is present in $\alpha$ and $\beta$)? I have been using thinni...
I wonder about the existence of "standard" statistical procedures for rounded (log)normal data. Indeed, in my work I often encounter rounded data which potentially cause some problems: "awful" qqplots, zeros for lognormal data... Do there exist in the literature some theoretical studies of usual statistical procedures ...
I want to know if changing a button color has a positive effect on different measures (see the 4 measures below), using the following process: There's a default button, which is the fixed control group with no changes. This means I'm interested in one-tailed p-values for pair-wise comparisons. 3 different button color...
I'm trying to generate correlated data (preferably multinormal) with predefined correlations (e.g. 0.35 or 0.9). Any idea how I can do it? I'm using R and I did find a way to generate this (using mvrnorm), but you need to supply a covariance matrix. I have a covariance matrix with correlations around 0.9; however, I do...
I stumbled accross this related question from 2010, and I wonder if there has been any progress on using multiple imputation for mixed effects models ? I prefer to use R, though Stata is also available to me.
I am relatively new to machine learning and I have a data classification problem where each sample has ~1500 features (continuous) and the category is binary. I want to apply logistic regression, for learning purposes. I have done a vectorized implementation in Python, which works very well and is fast on other dataset...
R's multcompView package offers a seemingly useful set of tools to visualize the results of multiple comparisons, e.g. Tukey HSD analysis, including boxplots and 'letters' to identify significantly-different groups. It also provides a "t" depiction, in which groups are labeled with either a box, a sort of pyramid, or n...
I have a hierarchical model that I need to validate. My model is as follows: we have a collection of $\lambda_i$ that we draw from $Gamma(\alpha,\beta)$. Then, we draw our data point $y_i$ from $Poisson(\lambda_i)$. I get a distribution of $\alpha,\beta,\{\lambda_i\}$ via a Gibbs sampler combined with a Metropolis step...
I'm trying to estimate a parameter based on its past history. However, I do not have the observed data at every point of time. To illustrate the scenario, consider a group of N people where each person estimates how many email the remaining N-1 persons would receive the next day. These people meet infrequently; when X ...
I have data that were collected at a number of sites, and each site was located within one of three zones (Lake Ontario, Erie and the St. Lawrence), so I was hoping to do nested ANOVAs to compare between sites and zones. Unfortunately I have an unequal number of sites in each zone (3, 4 and 5 respectively) due to not e...
ok, so I have a memory-based model to predict the values of variable X and I've also measured the real values of X. I have calculated both the RMSE and MAPE for the difference Xreal-Xpredicted. I know that there is absolutely no point in saying a model is good or bad if the RMSE value is less than a particular value. I...
It has been shown that ABC model choice using Bayes factors is not to be recommended due to the presence of an error coming from the use of summary statistics. The conclusion in this paper relies on the study of the behaviour of a popular method for approximating the Bayes factor (Algorithm 2). It is well known that Ba...
Does someone know if it exists some way to do online learning with pLSA? The model training is really time consuming, so it is not feasible to rebuild it after every changes in the data.
I have a data frame consisting of evaluations made by students of other student fellows. An excerpt of the evaluations data frame looks like this (columns are evaluators, rows correspond to the evaluated student): s1 s2 s3 s4 1 7 8 NA 8 2 NA 7 8 ...
I'm looking at 2 papers which are addressing the same issue using a retrospective cohort study design but use different methodology to analyse data and I would like to know why the methods used differ? When and why would you use standardized rate ratios? When and why would you use Poisson regression?
I'm creating a program that identifies trending music artists that uses Twitter metrics. I have data in a histogram format that represents the frequency of twitter @mentions of an artist for the last 30 days. I need my program to recognize a "significant" change (number that is quite greater than the rest in the sample...
Thinking about probability always makes me realize how bad I am at counting... Consider a sequence of $n$ base letters $A,\; T, \; C, \text{ and } G$, each equally likely to appear. What is the probability that this sequence contains a particular sequence of base pairs of interest of length $r\leq n$? There are $4^n$ d...
Running a logistic regression we get p-values for all the input variables which helps us choose significant inputs. Similarly can we use the classification trees to pick variables that are split, and use those variables in the model? I think the fact that splitting the dataset on a variable leads to lower classificatio...
The Bradley–Terry–Luce(BTL) model states that $p_{ji} = logit^{-1}(\delta_j - \delta_i)$, where $p_{ij}$ is the probability that object $j$ is judged to be "better", heavier, etc, than object $i$, and $\delta_i$, and $\delta_j$ are parameters. This seems to be a candidate for the glm function, with family = binomial. ...
I am ranking candidate models using Akaike information criterion (AIC). All my models have positive -2*LL (log likelihood) values which as far as I understand is expected under certain circumstances and not much of a problem... ...unless - and this is just me wondering - I want to rank models using AIC=-2*LL+(2k) with ...
My data is a time series of employed population, L, and the time span, year. n.auto=auto.arima(log(L),xreg=year) summary(n.auto) Series: log(L) ARIMA(2,0,2) with non-zero mean Coefficients: ar1 ar2 ma1 ma2 intercept year 1.9122 -0.9567 -0.3082 0.0254 -3.5904 0.0074 s.e. Na...
Does anyone understand how the argument "span" is used in spec.pgram in R? From the help menu, it provides the following examples: spectrum(ldeaths) spectrum(ldeaths, spans = c(3,5)) gives bandwidth= 0.241 spectrum(ldeaths, spans = c(5,7)) gives bandwidth= 0.363 spectrum(ldeaths, spans = 3) gives bandwidth= 0.1...
I need to generate simulated data for a conditional logistic regression using R. The code I wrote appears correct, but something is wrong. After generating my data, betas, and labels, I use glm() to attempt to estimate the betas. If everything is correct, the estimated betas from glm should be very close to the true ...
I am looking for a way to do nonlinear partial least squares in R or matlab. I thought kernel pls was a way to do it but it is not directly related to nonlinear pls. Do I have to calculate my own nonlinear kernel matrix and pass it to kernel pls? Any hint would be appreciated. Update: I don't think there is any direct ...