[R] about lm()

Bert Gunter gunter.berton at gene.com
Sun Mar 30 21:46:27 CEST 2014


1. Post in plain text, not HTML.

2. Read ?lm and note the data argument. Use it in your lm call instead
of all the xxxx$data extractions.

3. Your problem is with the summary() call, so read ?summary.lm. Learn
about S3 methods if you do not know where the ".lm" part is coming
from by reading the "Introduction to R " tutorial that ships with R,
which you should have read already anyway.

Cheers,
Bert

Bert Gunter
Genentech Nonclinical Biostatistics
(650) 467-7374

"Data is not information. Information is not knowledge. And knowledge
is certainly not wisdom."
H. Gilbert Welch




On Sun, Mar 30, 2014 at 9:43 AM, Frank Schwidom <schwidom at gmx.net> wrote:
> Please provide some data from your variable data.
>
> Show the output of dput( data) or an subset
> of data which leads toe the specific error.
>
> Regards
>
>
> On Sun, Mar 30, 2014 at 02:23:09PM +0100, Si Qi L. wrote:
>> Hi
>>
>> I have a problem with linear regression. This is my codes:
>>
>> acc1<- lm(data$acc ~ dummy + data$Reqloanamount + data$Code + data$Code.1 +
>> data$EmpNetMonthlyPay + data$Customer_Age + data$RTI)
>> summary(acc1)
>>
>> These attributes are all numerical except the "acc"(factors), so how can I
>> fix the problem R showed me? can anyone please help me out? Many thanks!
>>
>> But the R shows:
>>
>> Residuals:Error in quantile.default(resid) : factors are not allowedIn
>> addition: Warning message:In Ops.factor(r, 2) : ^ not meaningful for
>> factors
>>
>>       [[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.




More information about the R-help mailing list