Private Sub exporttoexcel(excelFileName)
excelFileName = 'File in my local'
Dim mySheetList() As String
Dim WS As Worksheets
Dim WB As Workbook
MsgBox excelFileName
'Dim sourceWB As Workbook
'Dim destWB As Workbook
'
'Set sourceWB = ActiveWorkbook
'sourceWB.Sheets.Copy
'
'Set WB = Workbooks(excelFileName)
ReDim mySheetList(0 To (ThisWorkbook.Sheets.Count) - 1)
Dim a As Integer
a = 0
For Each WS In ActiveWorkbook.Worksheets
mySheetList(a) = WS.Name
a = a + 1
Next
Dim Fileobj
Set Fileobj = CreateObject("Scripting.FileSystemObject")
If Fileobj.FileExists(excelFileName) Then
Fileobj.DeleteFile excelFileName
End If
' 'actually save
Worksheets(mySheetList).Copy '<<<<<<< RUN-TIME ERROR 9 RAISED HERE
ActiveWorkbook.SaveAs FileName:=excelFileName
'MsgBox excelFileName
'ThisWorkbook.SaveAs FileName:=excelFileName, FileFormat:=xlXMLSpreadsheet
Application.Wait (Now + TimeValue("0:00:15"))
WB.Close
End Sub
包中的lsmip()
命令似乎将x轴上的连续预测变量视为分类预测变量。
如果我以离散但不均匀的间隔从我的连续预测器中观察到(例如当你从燕麦数据中移除0.2水平的硝基时),lsmip无论如何都会以均匀的间隔绘制它们。
lsmeans
如果我想在实际观察数据的硝基水平上显示模型预测,这对我来说似乎很重要。从理论上讲,我应该能够在任何硝基水平上显示预测值。
data("Oats", package = "nlme")
Oats.lmer2sub <- lmer(log(yield) ~ Variety + poly(nitro,2)
+ (1|Block/Variety), data = subset(Oats, nitro!=0.2))
lsmip(Oats.lmer2sub, Variety ~ nitro, ylab = "Predicted log(yield)", cov.reduce=FALSE)
有没有办法设置x轴将nitro的值设置为适合连续变量的标度?含义在第一个图中跳过0.2的空格,或者在第二个图中将点聚为0.45,0.46?