0

I've imported my table from excel to r. I'm just struggling to find how to apply the equation to my data. For example my table has a list of suburbs down the side and then a list of suburb characteristics along the top. Say there's 120 suburbs and 28 variables/characteristics. My equation I've been told to use is:

fit <- factanal (filename [x : x+n], factors, rotation='varimax')

Should my equation look a little like this?

fit <- factanal (FileName [ 1 : 28], "Characteristic 1", "Characteristic 2" "etc" , rotation='varimax') 

I'm new to R and new to this site so sorry if this is hard to understand and I am happy to provide any more information! I'm just having a lot of trouble knowing how to make this equation work to make a factor analysis with my data. Thank you

Essentially all I want to know is what I should write into the equation. I have no idea what to write where it says 'factors' or what to write where it says [x:x+n]

Here's a screenshot of my R studio data set at the moment Please click the link for imgur below to see what data I'm dealing with. Also please keep in mind I don't know much technical language so layman terms would be very helpful for me. Thank you!

https://i.stack.imgur.com/e90dY.jpg

Ben Rodda
  • 9
  • 1
  • 1
  • Please don't share data as pictures. We can't use that to do anything. See: [How to make a great R reproducible example?](http://stackoverflow.com/questions/5963269) – Axeman Aug 08 '18 at 08:54
  • Axeman I only uploaded it for help so people would have context to my question. I don't think you can upload whole datasets on here, can you? – Ben Rodda Aug 08 '18 at 08:55
  • That is why I gave you that link :). One thing we _can_ tell from the picture, is that your data isn't loaded correctly. The first row contains the column names (headers). You need to use `header = TRUE` in `read.csv`. Perhaps this will solve your issue. – Axeman Aug 08 '18 at 08:56
  • I've checked out the link and tried to apply the codes to my data so I could show you all of my data but they all weren't working. I'm not sure what's going wrong. Also I tried to do the header=TRUE and it said – Ben Rodda Aug 08 '18 at 09:02
  • Error in read.table(file = file, header = header, sep = sep, quote = quote, : argument "file" is missing, with no default – Ben Rodda Aug 08 '18 at 09:02
  • Look at your picture, and the first line of code. Take that line of code, replace `FALSE` with `TRUE`. You can use the up-arrow key to cycle through previous commands. In general, you may want look up some general introductions to R and do some basic exercises. – Axeman Aug 08 '18 at 09:18
  • I would also strongly recommend working in an R script, instead of directly in the console. By typing `?factanal` you will get some help, which e.g. tells you that `factors` is just the number of factors to be fitted. – Axeman Aug 08 '18 at 09:20

0 Answers0