Re: [R] matrix multiplication question

From: Duncan Murdoch <murdoch_at_stats.uwo.ca>
Date: Fri, 18 Jul 2008 01:00:58 -0400

On 17/07/2008 9:47 PM, Murali K wrote:
> Hello,
> I am a newcomer to R and therefore apologize for posting such a
> basic question. I am
> trying to multiply 2 matrices t(X1)%*%X1, where t(X1) is:

It's hard to say for sure, but it looks as though X1 really isn't a numeric matrix. The "ones" and "Shadow" entries on the left look like character or factor data.

To find out what X1 is, you can run str(X1).

Duncan Murdoch
>
>
> 1 2 3 4 5 8 12 13 20 24 26 27 31 33 34 36 37 40 41 42 45 46
> 47 48 49
> ones 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
> 1 1 1 1 1
> Shadow 0 1 1 1 1 1 1 1 0 1 1 1 1 0 1 0 1 0 1 1
> 0 1 0 1 0
>
> However, when I try to perform this operation, I obtain:
> Error in t(X1) %*% X1 : requires numeric matrix/vector arguments
>
> Can someone please tell me what I seem to be doing wrong? thanks.
>
> Sincerely,
> Murali Kuchibhotla
>
>
> Murali Kuchibhotla
> Department of Economics
> Iowa State University
> Office:75,Heady
> Phone:515-294-5452
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help_at_r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.



R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Fri 18 Jul 2008 - 05:04:43 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 18 Jul 2008 - 10:32:24 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive