[R-SIG-Mac] Error scan update to question
David Kaplan
dkaplan at education.wisc.edu
Fri May 16 20:44:49 CEST 2008
Thanks Don. This is very helpful. I know about the input lines, but
this was for a class assignment.
David
===============================================================
David Kaplan, Ph.D.
Professor
Department of Educational Psychology
University of Wisconsin - Madison
Educational Sciences, Room, 1061
1025 W. Johnson Street
Madison, WI 53706
email: dkaplan at education dot wisc dot edu
homepage:
http://www.education.wisc.edu/edpsych/facstaff/kaplan/kaplan.htm
Phone: 608-262-0836
===============================================================
Don MacQueen wrote:
> It looks to me like Ken is correct.
>
> I you read the help page for specify.model(), it says that when no
> input file is specified (as here), then input comes from the "standard
> input stream" (i.e., the keyboard) and is terminated by a blank line.
>
> There is no blank line after input line #37
>
>>> 36: sodium <-> sodium, th16, NA
>>> 37: satfat <-> satfat, th17, NA
>>> 38: sem.model.KerryQ3 <- sem(model.KerryQ3, KerryQ3cov, 2123)
>>> 38: summary (sem.model.KerryQ3)
>
>
> David, did you really type in all those lines of the form
> f1 ->
> f2 ->
> and so on???
>
> I'd have at least put them in a file, and then given the file name to
> specify.model() !
>
> -Don
>
> At 7:19 AM +1000 5/16/08, Ken Beath wrote:
>> Hi,
>>
>> The problem is that specify.model() is not terminating its input and
>> so is reading R commands, see line 38. I have only looked at sem, but
>> maybe a blank line will work.
>>
>> Ken
>>
>> On 16/05/2008, at 6:15 AM, David Kaplan wrote:
>>
>>> Hi all,
>>>
>>> I was asked to provide a bit more information. Here is the output
>>> to the problem. Note that I changed the data format to
>>> tab-delimited and also used read.table, but to no avail. The
>>> problem is exactly the same when I use .csv data and read.csv. The
>>> program I'm using is John Fox's SEM program within R for Mac. The
>>> 2123 is the sample size and there are no missing data values, or any
>>> other peculiarities as far as I can see. The data are clean.
>>>
>>>
>>>
>>>> ## CFA for Kerry Data Set, Question 3
>>>> ## load the sem package
>>>>
>>>> KerryQ3 <- read.table("~/Desktop/KerryQ3a.txt", header=TRUE)
>>>> KerryQ3cov <- cov(KerryQ3)
>>>> model.KerryQ3 <- specify.model()
>>> 1: f1 -> calcm, lam11, NA
>>> 2: f1 -> phytoc, lam21, NA 3: f1 -> soypro, lam31, NA
>>> 4: f1 -> antiox, lam41, NA
>>> 5: f1 -> fiber, lam51, NA
>>> 6: f1 -> vitmin, lam61, NA
>>> 7: f1 -> protn, lam71, NA
>>> 8: f1 -> monoft, lam81, NA
>>> 9: f1 -> omega3, lam91, NA
>>> 10: f2 -> chol, lam102, NA
>>> 11: f2 -> fat, lam112, NA
>>> 12: f2 -> sugar, lam122, NA
>>> 13: f2 -> calor, lam132, NA
>>> 14: f2 -> recarb, lam142, NA
>>> 15: f2 -> trnsft, lam152, NA
>>> 16: f2 -> sodium, lam162, NA
>>> 17: f2 -> satfat, lam172, NA
>>> 18: f1 <-> f1, NA, 1
>>> 19: f2 <-> f2, NA, 1
>>> 20: f1 <-> f2, ph21, NA
>>> 21: calcm <-> calcm, th1, NA
>>> 22: phytoc <-> phytoc, th2, NA
>>> 23: soypro <-> soypro, th3, NA
>>> 24: antiox <-> antiox, th4, NA
>>> 25: fiber <-> fiber, th5, NA
>>> 26: vitmin <-> vitmin, th6, NA
>>> 27: protn <-> protn, th7, NA
>>> 28: monoft <-> monoft, th8, NA
>>> 29: omega3 <-> omega3, th9, NA
>>> 30: chol <-> chol, th10, NA
>>> 31: fat <-> fat, th11, NA
>>> 32: sugar <-> sugar, th12, NA
>>> 33: calor <-> calor, th13, NA
>>> 34: recarb <-> recarb, th14, NA
>>> 35: trnsft <-> trnsft, th15, NA
>>> 36: sodium <-> sodium, th16, NA
>>> 37: satfat <-> satfat, th17, NA
>>> 38: sem.model.KerryQ3 <- sem(model.KerryQ3, KerryQ3cov, 2123)
>>> 38: summary (sem.model.KerryQ3)
>>> Error in scan(file, what, nmax, sep, dec, quote, skip, nlines,
>>> na.strings, :
>>> scan() expected 'a real', got '2123)'
>>>> std.KerryQ3 <- standardized.coefficients(sem.model.KerryQ3)
>>> Error in standardized.coefficients(sem.model.KerryQ3) :
>>> object "sem.model.KerryQ3" not found
>>>>
>>>
>>> --
>>> ===============================================================
>>> David Kaplan, Ph.D.
>>> Professor
>>> Department of Educational Psychology
>>> University of Wisconsin - Madison
>>> Educational Sciences, Room, 1061
>>> 1025 W. Johnson Street
>>> Madison, WI 53706
>>>
>>> email: dkaplan at education dot wisc dot edu
>>> homepage:
>>> http://www.education.wisc.edu/edpsych/facstaff/kaplan/kaplan.htm
>>> Phone: 608-262-0836
>>>
>>> _______________________________________________
>>> R-SIG-Mac mailing list
>>> R-SIG-Mac at stat.math.ethz.ch
>>> https://stat.ethz.ch/mailman/listinfo/r-sig-mac
>>>
>>
>> _______________________________________________
>> R-SIG-Mac mailing list
>> R-SIG-Mac at stat.math.ethz.ch
>> https://stat.ethz.ch/mailman/listinfo/r-sig-mac
>
>
More information about the R-SIG-Mac
mailing list