search for: npreg

Displaying 12 results from an estimated 12 matches for "npreg".

Did you mean: noreg
2005 Jun 02
3
How to change all name of variables
Dear R-helpers, First I apologize if my question is quite simple I have a large datasets which more 100 variables. For a research I need to change all name of variables with add one or more letters on each variables. For example, > data(Pima.tr) > Pima.tr[1:5,] npreg glu bp skin bmi ped age type 1 5 86 68 28 30.2 0.364 24 No 2 7 195 70 33 25.1 0.163 55 Yes 3 5 77 82 41 35.8 0.156 35 No 4 0 165 76 43 47.9 0.259 26 No 5 0 107 60 25 26.4 0.133 23 No > > dimnames(Pima.tr)[[2]] [1] "npreg" "glu&...
2011 Sep 10
0
npreg: plotting out of sample, extremely large bandwidths
...x2, and a continuous outcome variable y. I am conducting a nonparametric regression of y on x1 and x2. The one somewhat unusual feature of these data is that, to be included in the dataset, x1 must be at least as large as x2. The basics of the analysis are to calculate the correct bandwidth using npregbw, use npreg to estimate the nonparametric regression (with the previously calculated bandwidth as an input), and plot the results using plot (which calls npplot). A simple simulated example is given below. Two things are happening in the analysis that I do not understand: First, although all the...
2018 Feb 03
0
Speeding up npreg
Dear all, I am using npreg from the np library to run a Kernel regression. My dataset is relatively large and has about 3000 observations. The dependent variable is continuous and I have a total of six independent variables -- two continuous, two ordinal and two categorical. The model converges without problems but it takes...
2011 Feb 28
1
mixture models/latent class regression comparison
...lass negative binomial regression, which the mmlcr package appears to support, however, the results for basic Poisson latent class regression appear to be inferior to the results from flexmix. Below is a simple reproducible example to illustrate the comparison: library(flexmix) library(mmlcr) data(NPreg) # from package flexmix m1 <- flexmix(yp ~ x, k=2, data=NPreg, model=FLXMRglm(family='poisson')) NPreg$id <- 1:200 # mmlcr requires an id column m2 <- mmlcr(outer=~1|id, components=list(list(formula=yp~x, class="poisonce")), data=NPreg, n.groups=2) # summary and coeffici...
2005 Mar 18
1
How to show which variables include in plot of classification tree
Dear all For my research, I am learning classification now. I was trying some example about classification tree pakages, such as tree and rpart, for instance, in Pima.te dataset have 8 variables (include class=type): library(rpart) library(datasets) pima.rpart <- rpart(type ~ npreg+glu+bp+skin+bmi+ped+age,data=Pima.te, method='class') plot(pima.rpart, uniform=TRUE) text(pima.rpart) summary(pima.rpart) In the result I found only 5 variables: npreg, glu, bmi, ped, and age were showing in the plot. Now, I have 50 variables in my dataset. The result my classification...
2010 Feb 09
0
Kernel density / weights matrix?
Dear everyone, I'm coding the Horowitz-Spokoiny (2001) test [1], and I would be very grateful or some advice regarding the Kernel density (apologies beforehand if my terminology is not fully correct). I have looked into ksmooth and npreg, but with no success. Given a (n x p) matrix of covariates X, I need to construct the following matrix of Kernel densities or weights: w(x_i, x_j) = K(x_i - x_j) ----------------------------- sum_{k=1}^n K(x_i - x_k) where x_i, x_j, x_k are (1 x p) vectors, and K is a multivariate...
2008 Jul 25
0
Package np version 0.20-0 released to CRAN
...derivative and integral), which can be selected via the 'operator' argument. * automatic bandwidth searches are now performed when attempting to evaluate on data without bandwidths. * npsigtest interface brought in line with other functions. * significance tests can now be performed on npreg outputs. * added a vignette and faq. * summary on npconmode now properly retrieves names from bandwidth objects. * fixed the 6th and 8th order epanechnikov kernels. * fixed some quietness issues. * npplot now returns data upon request for conditional densities. * npreg and npcdens now take the a...
2008 Jul 25
0
Package np version 0.20-0 released to CRAN
...derivative and integral), which can be selected via the 'operator' argument. * automatic bandwidth searches are now performed when attempting to evaluate on data without bandwidths. * npsigtest interface brought in line with other functions. * significance tests can now be performed on npreg outputs. * added a vignette and faq. * summary on npconmode now properly retrieves names from bandwidth objects. * fixed the 6th and 8th order epanechnikov kernels. * fixed some quietness issues. * npplot now returns data upon request for conditional densities. * npreg and npcdens now take the a...
2009 Dec 04
0
flexmix and mclust help
...ns_call$cluster), data=Data, k = number_clusters, model = FLXMRglm(family = "Gamma" ) ) and found Error in model.frame.default(model at fullformula, data = data, na.action = NULL) : invalid type (list) for variable 'chr18_test_binned' I think it wants a "list" (like NPreg in the examples, a "struct" in MATLAB), but I'm so new at R that I don't really know what I'm doing. Can anyone give me a simple example of how take a vector of data and ask it to perform a gamma mixture EM on it using flexmix, or even more ideally, how to use do either logn...
2011 Jul 20
0
np package, KleinSpady estimator, error when I estimate the bootstrapped standard errors
...ndex(KS, gradients=T, boot.num=300) vcov(KSi) This is fine so far, but if I want to estimate the bootstrapped standard errors on estimates by se(KSi) then the result is NA and if I include the argument errors=TRUE instead of the default errors=FALSE as I think I should, I get the error: Error in npreg(regtype = "lc", gradients = TRUE, txdat = rindex, tydat = tydat[indices], : argument is missing, with no default I couldn't find though any argument without a default. So, how can I get the bootstrapped errors? Thank you Dimitris -- View this message in context: http://r.789...
2011 Dec 21
0
Estimating a latent class multinomial logit regression with flexmix
I am trying to estimate a latent class multinomial logit regression with flexmix. I am not sure if I should do it as follows: m4<-flexmix(cbind(y,1-y)~x1+x2|id,model=FLXMRglm(family="binomial"),data=NPreg,k=2) , where id links each row with the corresponding respondent. Each respondent has 4 alternatives to chose from. y takes the value 1 only for the alternative chosen; x1 and x2 are alternative-specific variables (thus they take different values in each row) I will much appreciate your help....
2012 Mar 23
0
loops
Hi I'm running QDA on some data and calculating the discriminant function. qda.res <- qda(type ~ npreg + glu + bp + skin + bmi + ped + age) ind_yes <- c(1:N)[type == "Yes"] > ind_no <- c(1:N)[type == "No"] > cov_yes <- cov(table[ind_yes, 1:7] ) > cov_no <- cov(table[ind_no, 1:7] ) > covar<-list(cov_no, cov_yes) qdf<- function(x, prior, mu, cova...