similar to: "Object is not a matrix" Error

Displaying 20 results from an estimated 20000 matches similar to: ""Object is not a matrix" Error"

2009 Dec 21
3
Signif. codes
My question is about the "Signif. codes" and the p-value, specifically, the output when I run summary(nameofregression.lm) So you get this little key: Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 And on a regression I ran, next to the intercept data, I get '***' Coefficients: > > Estimate Std. Error t value Pr(>|t|) > >
2013 Jan 30
1
Creating dummy variables in r
Hello, Semi-new r user here and still learning the ropes. I am creating dummy variables for a dataset on stock prices in r. One dummy variable is called prev1 and is: prev1 <- ifelse(ret1 >= .5, 1, 0) where ret1 is the previous day's return. The variable "prev1" is created fine and works in my regression model and for running conditional statistics. However, when I call the
2011 Sep 14
1
Hints for Data Mining
Dear All, I am recycling a previous email of mine where I asked some questions about clustering mixed numerical/categorical data. This time I am more into data mining. I am given a set of known statistical indexes {s_i}, i=1,2...N for a N countries. These indexes in general are a both numerical and categorical variables. For each country, I also have a property x_i whose value is known, but
2013 May 01
2
Factors and Multinomial Logistic Regression
Dear All, I am trying to reproduce the example that I found online here http://bit.ly/11VG4ha However, when I run my script (pasted at the end of the email), I notice that there is a factor 2 between the values for the coefficients for the categorical variable female calculated by my script and in the online example. Any idea about where this difference comes from? Besides, how can I
2012 Oct 23
1
Testing proportional odds assumption in R
I want to test whether the proportional odds assumption for an ordered regression is met. The UCLA website points out that there is no mathematical way to test the proportional odds assumption (http://www.ats.ucla.edu/stat//R/dae/ologit.htm), and use graphical inspection ("We were unable to locate a facility in R to perform any of the tests commonly used to test the parallel slopes
2007 May 23
2
saving datafreame object problem
Do I miss here something? dtaa = read.table("http://www.ats.ucla.edu/stat/mplus/examples/ma_snijders/mlbook1.dat", sep=",") head(dtaa) # shows the data as it should be save(dtaa,"dtaa",file="c:/dtaa") d = load("c:/dtaa") head(d) # all data is lost, it only shows [1] "dtaa" "dtaa" Thanks for your hint on this.
2012 Jul 27
1
Understanding the intercept value in a multiple linear regression with categorical values
Hi! I'm failing to understand the value of the intercept value in a multiple linear regression with categorical values. Taking the "warpbreaks" data set as an example, when I do: > lm(breaks ~ wool, data=warpbreaks) Call: lm(formula = breaks ~ wool, data = warpbreaks) Coefficients: (Intercept) woolB 31.037 -5.778 I'm able to understand that the value of
2004 Jun 02
2
poisson regression with robust error variance ('eyestudy')
Dear all, i am trying to redo the 'eyestudy' analysis presented on the site http://www.ats.ucla.edu/stat/stata/faq/relative_risk.htm with R (1.9.0), with special interest in the section on "relative risk estimation by poisson regression with robust error variance". so i guess rlm is the function to use. but what is its equivalent to the glm's argument "family"
2012 Jul 27
1
Turn categorical array into matrix with dummy variables
Hi All, I want to turn a categorical array (array with factors) into a matrix with dummy variables. like array=c(a,a,b,b,b) should be turned into: a b 1 0 1 0 0 1 0 1 0 1 Do you know any way of doing this? Thanks -- View this message in context: http://r.789695.n4.nabble.com/Turn-categorical-array-into-matrix-with-dummy-variables-tp4638134.html Sent from the R help mailing list archive at
2010 Oct 14
1
Regression with groups and nested sub-groups
I have the following formula for a linear model: z <- lm(y~x + factor(a) + factor(b), data=NT2010) where a (groups) and b (Sub-groups) are categorical variables (factors), x is a continuous covariate, and y the response variable. Since b is nested within a, the formula can also be written as: z <- lm(y~x + factor(a) + factor(a)/factor(b), data=NT2010) and the same output is achieved
2010 Jun 10
3
Finding distance matrix for categorical data
All, How can we find a distance matrix for categorical data ie. given a csv below var1 var2 var3 var4 element1-1 yes x a k element1-2 no y b l element1-3 maybe y c m how can i compute the distance matrix between all the elements Actually i need it to create clusters on top
2008 Jun 15
2
R vs SAS and HLM on multilevel analysis- basic question
Hi R users! I am trying to learn some multilevel analysis, but unfortunately i am now very confused. The reason: http://www.ats.ucla.edu/stat/hlm/seminars/hlm_mlm/mlm_hlm_seminar.htm http://www.ats.ucla.edu/stat/sas/seminars/sas_mlm/mlm_sas_seminar.htm and MlmSoftRev. pdf from mlmRev package. >From what i see, the first two links seem to declare the level one variable as a random part (i
2008 Sep 27
1
A Book for SAS, SPSS and R students
Hi List, I had the pleasure of taking Dr Bob Muenchen's interview for his upcoming book R For SAS and SPSS users. He has spent 27 years in this field while I have spent almost that much on earth. So this is more like a fan blog interview. I thought it would be of use to people curious about R, or even SAS , or SPSS if they have not worked on either of these packages before. Having fought my
2008 Feb 20
1
insert() function
Hello, I am trying to insert a certain number of points into a certain position of a vector with this code: x <- seq(1:10909) x1 <- c(13112-10909) spect1 <- rnorm(13112) interpol <- approx(x,spect1,xout=c(seq(from=1, by=((10909 - 1)/(x1 - 1)), length.out=x1))) pos <- round(interpol$x,0) intensities <- interpol$y spect2 <- insert(spect1,ats=pos,values=intensities)
2003 Dec 04
2
Comparing Negative Binomial Regression in Stata and R. Constants differ?
I looked for examples of count data that might interest the students and found this project about dropout rates in Los Angeles High Schools. It is discussed in the UCLA stats help pages for the Stata users: http://www.ats.ucla.edu/stat/stata/library/count.htm and See: http://www.ats.ucla.edu/stat/stata/library/longutil.htm To replicate those results, I used R's excellent foreign package to
2010 Mar 07
3
mlogit
I am trying to follow this example for multinomial logistic regression http://www.ats.ucla.edu/stat/r/dae/mlogit.htm However, I cannot get it to work properly. This is the output I get, and I get an error when I try to use the mlogit function. Any ideas as to why this happens? > mydata <- read.csv(url("http://www.ats.ucla.edu/stat/r/dae/mlogit.csv")) > attach(mydata) >
2010 Feb 25
1
Heterogeneous Correlation Matrix with Survey Weights
Hello, I have a data set containing categorical and ordinal factors, as well as sampling weights (i.e., survey weights reflecting unequal probabilities of selection). I want to fit a structural equation model with sem(). I have run sem() on weighted covariance matrices using advice from John Fox (see <http://tolstoy.newcastle.edu.au/R/e5/help/08/12/8773.html> and
2004 Dec 03
4
factor matrix
Sorry if this is a FAQ. Is there a good reason why a factor has to be a one-dimensional vector and cannot be a matrix? I want to construct matrices of categorical values. Vain attempts like matrix(factor(c(T,F,F,T), 2,2) yield a matrix of character strings representing the factor levels, not the levels themselves, while factor(matrix(c(T,F,F,T), 2,2)) converts the matrix to a
2013 Jan 17
3
Colors in interaction plots
Hi, I am trying to plot an interaction.plot with different color for each level of a factor. It has an erratic behavior. For example, it works for the first interaction.plot below, with the example from the ALDA book, but not with the other plots, from the NPK dataset: # from http://www.ats.ucla.edu/stat/r/examples/alda/ch2.htm tolerance <-
2009 Oct 03
3
How to deal with this :" object ' obs' not found.
Hi guys, I need your help. I'm trying to sort the data by the variable "obs". This is how I tried to sort the data below. The problem is, I have a variable name "obs"; this is.. a counter variable. something like _n_ in SAS. I do not know why it is not working. I even tried a similar example in UCLA webpage: http://www.ats.ucla.edu/stat/R/faq/sort.htm :it also does not